随笔分类 -  LeetCode

1 2 3 4 5 ··· 7 下一页

LeetCode 212: Word Search II
摘要:https://leetcode.com/problems/word-search-ii/description/ Given a 2D board and a list of words from the dictionary, find all words in the board. Each 阅读全文

posted @ 2017-09-17 12:37 Yu's Garden 阅读(1408) 评论(0) 推荐(0) 编辑

LeetCode: Lowest Common Ancestor of a Binary Search Tree 解题报告
摘要:https://leetcode.com/submissions/detail/32662938/Given a binary search tree (BST), find the lowest common ancestor (LCA) of two given nodes in the BST... 阅读全文

posted @ 2015-07-11 14:50 Yu's Garden 阅读(2282) 评论(1) 推荐(1) 编辑

LeetCode: Unique Paths II 解题报告
摘要:Unique Paths IITotal Accepted:31019Total Submissions:110866My SubmissionsQuestionSolutionFollow up for "Unique Paths":Now consider if some obstacles a... 阅读全文

posted @ 2015-04-08 03:04 Yu's Garden 阅读(611) 评论(0) 推荐(0) 编辑

LeetCode: Unique Paths 解题报告
摘要:A robot is located at the top-left corner of amxngrid (marked 'Start' in the diagram below).The robot can only move either down or right at any point ... 阅读全文

posted @ 2015-04-08 02:38 Yu's Garden 阅读(768) 评论(0) 推荐(0) 编辑

LeetCode: Remove Nth Node From End of List 解题报告
摘要:Remove Nth Node From End of ListTotal Accepted:46720Total Submissions:168596My SubmissionsQuestionSolutionGiven a linked list, remove thenthnode from ... 阅读全文

posted @ 2015-04-04 15:25 Yu's Garden 阅读(844) 评论(0) 推荐(0) 编辑

LeetCode: Convert Sorted List to Binary Search Tree 解题报告
摘要:Convert Sorted List to Binary Search TreeGiven a singly linked list where elements are sorted in ascending order, convert it to a height balanced BST.... 阅读全文

posted @ 2015-04-04 13:48 Yu's Garden 阅读(1670) 评论(0) 推荐(0) 编辑

LeetCode: Unique Binary Search Trees II 解题报告
摘要:Unique Binary Search Trees IIGiven n, generate all structurally unique BST's (binary search trees) that store values 1...n.For example,Given n = 3, yo... 阅读全文

posted @ 2015-01-28 16:40 Yu's Garden 阅读(2411) 评论(0) 推荐(1) 编辑

LeetCode: Largest Number 解题报告 以及Comparator, CompareTo 应用
摘要:Largest NumberGiven a list of non negative integers, arrange them such that they form the largest number.For example, given [3, 30, 34, 5, 9], the lar... 阅读全文

posted @ 2015-01-20 09:47 Yu's Garden 阅读(5024) 评论(0) 推荐(1) 编辑

LeetCode: Permutation Sequence 解题报告
摘要:PermutationSequence https://oj.leetcode.com/problems/permutation-sequence/The set [1,2,3,…,n] contains a total of n! unique permutations.By listing a... 阅读全文

posted @ 2015-01-14 18:03 Yu's Garden 阅读(1325) 评论(0) 推荐(0) 编辑

LeetCode: Next Permutation 解题报告
摘要:Next PermutationImplement next permutation, which rearranges numbers into the lexicographically next greater permutation of numbers.If such arrangemen... 阅读全文

posted @ 2015-01-13 17:58 Yu's Garden 阅读(965) 评论(0) 推荐(0) 编辑

LeetCode: Subsets 解题报告
摘要:SubsetsGiven a set of distinct integers, S, return all possible subsets.Note:Elements in a subset must be in non-descending order.The solution set mus... 阅读全文

posted @ 2015-01-08 20:05 Yu's Garden 阅读(9911) 评论(1) 推荐(0) 编辑

LeetCode: Recover Binary Search Tree 解题报告
摘要:Recover Binary Search TreeTwo elements of a binary search tree (BST) are swapped by mistake.Recover the tree without changing its structure.Note:A sol... 阅读全文

posted @ 2015-01-07 14:06 Yu's Garden 阅读(2665) 评论(0) 推荐(0) 编辑

LeetCode: Find Peak Element 解题报告
摘要:Find Peak ElementA peak element is an element that is greater than its neighbors.Given an input array wherenum[i] ≠ num[i+1], find a peak element and ... 阅读全文

posted @ 2015-01-05 01:55 Yu's Garden 阅读(940) 评论(0) 推荐(0) 编辑

LeetCode: Valid Parentheses 解题报告
摘要:Valid ParenthesesGiven a string containing just the characters'(',')','{','}','['and']', determine if the input string is valid.The brackets must clos... 阅读全文

posted @ 2015-01-04 21:49 Yu's Garden 阅读(653) 评论(0) 推荐(0) 编辑

LeetCode: First Missing Positive 解题报告
摘要:First Missing PositiveGiven an unsorted integer array, find the first missing positive integer.For example,Given[1,2,0]return3,and[3,4,-1,1]return2.Yo... 阅读全文

posted @ 2015-01-03 22:45 Yu's Garden 阅读(5227) 评论(4) 推荐(0) 编辑

LeetCode: Best Time to Buy and Sell Stock III 解题报告
摘要:Best Time to Buy and Sell Stock IIIQuestion SolutionSay you have an array for which the ith element is the price of a given stock on day i.Design an a... 阅读全文

posted @ 2015-01-03 18:51 Yu's Garden 阅读(791) 评论(0) 推荐(0) 编辑

LeetCode: Best Time to Buy and Sell Stock II 解题报告
摘要:Best Time to Buy and Sell Stock IIQuestion SolutionSay you have an array for which the ith element is the price of a given stock on day i.Design an al... 阅读全文

posted @ 2015-01-03 18:39 Yu's Garden 阅读(617) 评论(0) 推荐(0) 编辑

LeetCode: Best Time to Buy and Sell Stock 解题报告
摘要:Best Time to Buy and Sell StockSay you have an array for which theithelement is the price of a given stock on dayi.If you were only permitted to compl... 阅读全文

posted @ 2015-01-03 18:34 Yu's Garden 阅读(518) 评论(0) 推荐(0) 编辑

LeetCode: Construct Binary Tree from Inorder and Postorder Traversal 解题报告
摘要:Construct Binary Tree from Inorder and Postorder TraversalGiven inorder and postorder traversal of a tree, construct the binary tree.Note:You may assu... 阅读全文

posted @ 2015-01-03 16:36 Yu's Garden 阅读(374) 评论(0) 推荐(0) 编辑

LeetCode: Construct Binary Tree from Preorder and Inorder Traversal 解题报告
摘要:Construct Binary Tree from Preorder and Inorder TraversalGiven preorder and inorder traversal of a tree, construct the binary tree.Note:You may assume... 阅读全文

posted @ 2015-01-03 00:39 Yu's Garden 阅读(370) 评论(0) 推荐(0) 编辑

1 2 3 4 5 ··· 7 下一页

导航