Tag: DP

Leetcode 4. Median of Two Sorted Arrays

No Picture

题目链接 Leetcode 4. Median of Two Sorted Arrays   题目描述很简单,就是找到两个有序数组合并后的中位数,要求时间复杂度O(log (m+n))。

Read More »

Leetcode 516. Longest Palindromic Subsequence

No Picture

题目链接 Given a string s, find the longest palindromic subsequence’s length in s. You may assume that the maximum length of s is 1000.

Read More »

Leetcode 467. Unique Substrings in Wraparound String

No Picture

题目链接:Unique Substrings in Wraparound String 这里加段英文,不是为了凑字数,而是为了让别人搜索题目的时候能搜到我的博客。。 Consider the string s to be the infinite wraparound string of “abcdefghijklmnopqrstuvwxyz”, so s will look like this: “…zabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcd….”.

Read More »

Leetcode 368. Largest Divisible Subset

No Picture

题目链接:368. Largest Divisible Subset Given a set of distinct positive integers, find the largest subset such that every pair (Si, Sj) of elements in this subset satisfies: Si % Sj = 0 or Sj % Si = 0….

Read More »

Leetcode 53. Maximum Subarray

No Picture

题目链接: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 the largest sum = 6.   题意简单,给出一个数组,求出其中最大的子数组和。

Read More »