摘要:终于将LeetCode的大部分题刷完了,真是漫长的第一遍啊,估计很多题都忘的差不多了,这次开个题目汇总贴,并附上每道题目的解题连接,方便之后查阅吧~ 对应的 Github 项目的同步地址如下,欢迎大家关注点赞❤️ https://github.com/grandyang/leetcode 如果各位看 阅读全文
posted @ 2015-06-28 23:20 Grandyang 阅读 (640605) 评论 (146) 编辑
摘要:Given a rooted binary tree, return the lowest common ancestor of its deepest leaves. Recall that: The node of a binary tree is a leaf if and only if i 阅读全文
posted @ 2019-08-22 22:39 Grandyang 阅读 (19) 评论 (0) 编辑
摘要:We are given a list of (axis aligned) . Each , where (x1, y1) are the coordinates of the bottom left corner, and (x2, y2) are the coordinates of the t 阅读全文
posted @ 2019-08-18 02:56 Grandyang 阅读 (52) 评论 (0) 编辑
摘要:Given an array of integers, for each integer we need to choose either or , and add to . After this process, we have some array . Return the smallest p 阅读全文
posted @ 2019-08-15 23:29 Grandyang 阅读 (33) 评论 (0) 编辑
摘要:Strings and are similar (for some non negative integer ) if we can swap the positions of two letters in exactly times so that the resulting string equ 阅读全文
posted @ 2019-08-13 02:37 Grandyang 阅读 (78) 评论 (0) 编辑
摘要:On an N x N , the numbers from to are written boustrophedonically starting from the bottom left of the board, and alternating direction each row. For 阅读全文
posted @ 2019-08-12 21:16 Grandyang 阅读 (46) 评论 (0) 编辑
摘要:There are workers. The th worker has a and a minimum wage expectation . Now we want to hire exactly workers to form a paid group . When hiring a group 阅读全文
posted @ 2019-08-09 20:34 Grandyang 阅读 (106) 评论 (0) 编辑
摘要:Given an array of integers, for each integer we may choose any with ` K 这道题说是给了一个非负数的数组,和一个非负数K,说是数组中的每一个数字都可以加上 [ K, K] 范围内的任意一个数字,问新数组的最大值最小值之间的差值最小 阅读全文
posted @ 2019-08-07 22:20 Grandyang 阅读 (78) 评论 (0) 编辑
摘要:Return the length of the shortest, non empty, contiguous subarray of with sum at least . If there is no non empty subarray with sum at least , return 阅读全文
posted @ 2019-08-04 22:01 Grandyang 阅读 (85) 评论 (0) 编辑
摘要:Given an array of integers , find the sum of , where ranges over every (contiguous) subarray of . Since the answer may be large, return the answer mod 阅读全文
posted @ 2019-07-30 22:53 Grandyang 阅读 (134) 评论 (0) 编辑
摘要:We are given a 2 dimensional . is an empty cell, is a wall, is the starting point, ( , , ...) are keys, and ( , , ...) are locks. We start at the star 阅读全文
posted @ 2019-07-20 23:27 Grandyang 阅读 (142) 评论 (0) 编辑