Tag: 动态规划

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 62. Unique Paths & 63. Unique Paths II

No Picture

好久没刷题了,今天来俩道简单题。 Leetcode 62. Unique Paths Leetcode 63. Unique Paths II

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 »

Leetcode 377. Combination Sum IV

No Picture

题目链接:Combination Sum IV Given an integer array with all positive numbers and no duplicates, find the number of possible combinations that add up to a positive integer target.

Read More »

Leetcode 198. House Robber

No Picture

原题链接:198. House Robber   一句话理解题意,有个偷马贼晚上要偷尽可能值钱的马,但连续两头马被偷会触发报警,问他如何在不触发报警(不偷连续的两匹马)的情况下偷到总价值最高马,返回最高总价值。   看到maximum,就应该想到这是应该求解最优的问题,一想到求解最优,一般除了暴力就是动态规划了。

Read More »