随笔分类 -  LeetCode

上一页 1 ··· 15 16 17 18 19 20 21 22 23 ··· 61 下一页
摘要:A full binary tree is a binary tree where each node has exactly 0 or 2 children. Return a list of all possible full binary trees with nodes. Each elem 阅读全文
posted @ 2019-05-30 22:34 Grandyang 阅读(3406) 评论(0) 推荐(1) 编辑
摘要:You are given an array of strings. Two strings and are special equivalent if after any number of moves , S == T. A move consists of choosing two indic 阅读全文
posted @ 2019-05-28 23:25 Grandyang 阅读(1800) 评论(0) 推荐(0) 编辑
摘要:On a grid, we place some cubes. Each value represents a tower of cubes placed on top of grid cell . Return the total surface area of the resulting sha 阅读全文
posted @ 2019-05-26 23:28 Grandyang 阅读(2016) 评论(0) 推荐(0) 编辑
摘要:You have a list of and a , and you want to know which words in matches the pattern. A word matches the pattern if there exists a permutation of letter 阅读全文
posted @ 2019-05-24 22:06 Grandyang 阅读(2379) 评论(0) 推荐(0) 编辑
摘要:Return any binary tree that matches the given preorder and postorder traversals. Values in the traversals and are distinct positive integers. Example 阅读全文
posted @ 2019-05-22 23:10 Grandyang 阅读(4043) 评论(2) 推荐(1) 编辑
摘要:Alice and Bob have candy bars of different sizes: is the size of the th bar of candy that Alice has, and is the size of the th bar of candy that Bob h 阅读全文
posted @ 2019-05-20 19:45 Grandyang 阅读(2220) 评论(0) 推荐(0) 编辑
摘要:On a 2 dimensional grid with rows and columns, we start at facing east. Here, the north west corner of the grid is at the first row and column, and th 阅读全文
posted @ 2019-05-18 23:04 Grandyang 阅读(2637) 评论(0) 推荐(1) 编辑
摘要:We are given two sentences and . (A sentence is a string of space separated words. Each word consists only of lowercase letters.) A word is uncommon i 阅读全文
posted @ 2019-05-16 20:42 Grandyang 阅读(1653) 评论(0) 推荐(1) 编辑
摘要:On a grid, we place some cubes that are axis aligned with the x, y, and z axes. Each value represents a tower of cubes placed on top of grid cell . No 阅读全文
posted @ 2019-05-15 00:06 Grandyang 阅读(1850) 评论(0) 推荐(0) 编辑
摘要:The th person has weight , and each boat can carry a maximum weight of . Each boat carries at most 2 people at the same time, provided the sum of the  阅读全文
posted @ 2019-05-12 23:48 Grandyang 阅读(2741) 评论(1) 推荐(0) 编辑
摘要:An encoded string is given. To find and write the decoded string to a tape, the encoded string is read one character at a time and the following steps 阅读全文
posted @ 2019-05-10 23:20 Grandyang 阅读(4816) 评论(1) 推荐(0) 编辑
摘要:Alex and Lee play a game with piles of stones. There are an even number of piles arranged in a row, and each pile has a positive integer number of sto 阅读全文
posted @ 2019-05-07 22:44 Grandyang 阅读(7702) 评论(4) 推荐(0) 编辑
摘要:Given a non empty, singly linked list with head node , return a middle node of linked list. If there are two middle nodes, return the second middle no 阅读全文
posted @ 2019-05-06 01:00 Grandyang 阅读(3319) 评论(0) 推荐(0) 编辑
摘要:Koko loves to eat bananas. There are piles of bananas, the th pile has bananas. The guards have gone and will come back in hours. Koko can decide her 阅读全文
posted @ 2019-05-03 23:43 Grandyang 阅读(5408) 评论(1) 推荐(1) 编辑
摘要:A robot on an infinite grid starts at point (0, 0) and faces north. The robot can receive one of three possible types of commands: : turn left 90 degr 阅读全文
posted @ 2019-05-01 22:17 Grandyang 阅读(2736) 评论(0) 推荐(1) 编辑
摘要:In an array A containing only 0s and 1s, a *K-bit flip *consists of choosing a (contiguous) subarray of length K and simultaneously changing every 0 i 阅读全文
posted @ 2019-04-29 23:48 Grandyang 阅读(2088) 评论(7) 推荐(0) 编辑
摘要:A sequence is fibonacci like if: for all `i + 2 这道题给了我们一个数组,让找其中最长的斐波那契序列,既然是序列而非子数组,那么数字就不必挨着,但是顺序还是需要保持,题目中说了数组是严格递增的,其实博主认为这个条件可有可无的,反正又不能用二分搜索。关于斐 阅读全文
posted @ 2019-04-27 23:59 Grandyang 阅读(2966) 评论(0) 推荐(0) 编辑
摘要:Consider all the leaves of a binary tree. From left to right order, the values of those leaves form a leaf value sequence. For example, in the given t 阅读全文
posted @ 2019-04-25 23:27 Grandyang 阅读(2163) 评论(0) 推荐(0) 编辑
摘要:Given two arrays and of equal size, the advantage of with respect to is the number of indices for which . Return any permutation of that maximizes its 阅读全文
posted @ 2019-04-23 22:36 Grandyang 阅读(2647) 评论(0) 推荐(0) 编辑
摘要:Starting with a positive integer , we reorder the digits in any order (including the original order) such that the leading digit is not zero. Return i 阅读全文
posted @ 2019-04-21 23:57 Grandyang 阅读(2414) 评论(0) 推荐(0) 编辑

上一页 1 ··· 15 16 17 18 19 20 21 22 23 ··· 61 下一页
Fork me on GitHub