题目链接:Best Time to Buy and Sell Stock IIISay you have an array for which the ith element is the price of a given stock on day i.Design an algorithm to find the maximum ...
More »
题目链接:Best Time to Buy and Sell Stock IISay you have an array for which the i-th element is the price of a given stock on day i.Design an algorithm to find the maximum ...
More »
题目链接:Best Time to Buy and Sell StockSay you have an array for which the i-th element is the price of a given stock on day i.If you were only permitted to complete at m...
More »
题目链接:TriangleGiven a triangle, find the minimum path sum from top to bottom. Each step you may move to adjacent numbers on the row below.For example, given the followi...
More »
题目链接:Pascal’s Triangle IIGiven an index k, return the kth row of the Pascal’s triangle.For example, given k = 3,Return [1,3,3,1].Note:Could you optimize your algorithm...
More »
题目链接:Pascal’s TriangleGiven numRows, generate the first numRows of Pascal’s triangle.For example, given numRows = 5,Return[ [1], [1,1], [1,2,1], [1,3,3,1], [...
More »
题目链接:Populating Next Right Pointers in Each Node IIFollow up for problem “Populating Next Right Pointers in Each Node”.What if the given tree could be any binary tree?...
More »
题目链接:Populating Next Right Pointers in Each NodeGiven a binary tree struct TreeLinkNode { TreeLinkNode *left; TreeLinkNode *right; TreeLinkNode *n...
More »
题目链接:Distinct SubsequencesGiven a string S and a string T, count the number of distinct subsequences of T in S.A subsequence of a string is a new string which is forme...
More »