摘要: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
阅读全文
摘要: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...
阅读全文
摘要:Unique Paths IITotal Accepted:31019Total Submissions:110866My SubmissionsQuestionSolutionFollow up for "Unique Paths":Now consider if some obstacles a...
阅读全文
摘要: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 ...
阅读全文
摘要:Remove Nth Node From End of ListTotal Accepted:46720Total Submissions:168596My SubmissionsQuestionSolutionGiven a linked list, remove thenthnode from ...
阅读全文
摘要: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....
阅读全文
摘要: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...
阅读全文
摘要: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...
阅读全文
摘要:PermutationSequence https://oj.leetcode.com/problems/permutation-sequence/The set [1,2,3,…,n] contains a total of n! unique permutations.By listing a...
阅读全文
摘要:Next PermutationImplement next permutation, which rearranges numbers into the lexicographically next greater permutation of numbers.If such arrangemen...
阅读全文
摘要: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...
阅读全文
摘要: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...
阅读全文
摘要: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 ...
阅读全文
摘要:Valid ParenthesesGiven a string containing just the characters'(',')','{','}','['and']', determine if the input string is valid.The brackets must clos...
阅读全文
摘要: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...
阅读全文
摘要: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...
阅读全文
摘要: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...
阅读全文
摘要: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...
阅读全文
摘要:Construct Binary Tree from Inorder and Postorder TraversalGiven inorder and postorder traversal of a tree, construct the binary tree.Note:You may assu...
阅读全文
摘要:Construct Binary Tree from Preorder and Inorder TraversalGiven preorder and inorder traversal of a tree, construct the binary tree.Note:You may assume...
阅读全文