随笔分类 -  LeetCode

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

摘要: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 阅读(1423) 评论(0) 推荐(0)

摘要: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 阅读(2294) 评论(1) 推荐(1)

摘要: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 阅读(617) 评论(0) 推荐(0)

摘要: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 阅读(776) 评论(0) 推荐(0)

摘要: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 阅读(853) 评论(0) 推荐(0)

摘要: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 阅读(1682) 评论(0) 推荐(0)

摘要: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 阅读(2427) 评论(0) 推荐(1)

摘要: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 阅读(5075) 评论(0) 推荐(1)

摘要: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 阅读(1343) 评论(0) 推荐(0)

摘要: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 阅读(972) 评论(0) 推荐(0)

摘要: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 阅读(9959) 评论(1) 推荐(0)

摘要: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 阅读(2696) 评论(0) 推荐(0)

摘要: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 阅读(956) 评论(0) 推荐(0)

摘要: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 阅读(659) 评论(0) 推荐(0)

摘要: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 阅读(5264) 评论(4) 推荐(0)

摘要: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 阅读(800) 评论(0) 推荐(0)

摘要: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 阅读(627) 评论(0) 推荐(0)

摘要: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 阅读(528) 评论(0) 推荐(0)

摘要: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 阅读(382) 评论(0) 推荐(0)

摘要: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 阅读(381) 评论(0) 推荐(0)

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

导航