LeetCode
文章平均质量分 72
ArthurZhang_
这个作者很懒,什么都没留下…
展开
-
【LeetCode】114. Distinct Subsequences
一、题目Given 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 formed from the original string by deleting some (can be non...原创 2018-06-08 11:30:25 · 195 阅读 · 0 评论 -
最长公共子序列
一、题目Given two strings, find the longest common subsequence (LCS).Your code should return the length of LCS.Have you met this question in a real interview?YesExampleFor "ABCD" and "EDCA", the LCS is "A...原创 2018-06-08 11:50:15 · 219 阅读 · 0 评论 -
Lintcode76 最长增长(上升)子序列Longest Increasing Subsequence solution
一、题目Given a sequence of integers, find the longest increasing subsequence (LIS).You code should return the length of the LIS.Example For [5, 4, 1, 2, 3], the LIS is [1, 2, 3], return 3For [4, 2, 4, 5,...原创 2018-06-08 12:13:52 · 245 阅读 · 0 评论 -
LeetCode121/122/123 &终极[k]次交易
1.1 题目Say you have an array for which the ith element is the price of a given stock on day i.If you were only permitted to complete at most one transaction (ie, buy one and sell one share of the stock...原创 2018-06-09 16:19:10 · 490 阅读 · 0 评论 -
leetCode 53.Maximum Subarray
一、题目Find the contiguous subarray within an array (containing at least one number) which has the largest sum.For example, given the array [−2,1,−3,4,−1,2,1,−5,4], the contiguous subarray [4,−1,2,1] has...原创 2018-06-10 17:13:40 · 432 阅读 · 0 评论