![](https://img-blog.csdnimg.cn/20201014180756738.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
动态规划 Dynamic Programming
我家小狗迷路了
这个作者很懒,什么都没留下…
展开
-
[LeetCode] 357. Count Numbers with Unique Digits
Problem:Given a non-negative integer n, count all numbers with unique digits, x, where 0 ≤ x n.Example:Given n = 2, return 91. (The answer should be the total numbers in the range of 0 ≤ x原创 2017-12-13 00:19:55 · 156 阅读 · 0 评论 -
[剑指offer] 二维数组中的查找
Description:在一个二维数组中,每一行都按照从左到右递增的顺序排序,每一列都按照从上到下递增的顺序排序。请完成一个函数,输入这样的一个二维数组和一个整数,判断数组中是否含有该整数。Solution:class Solution {public: bool Find(int target, vector<vector<int> > array) { ...原创 2018-03-31 01:17:02 · 152 阅读 · 0 评论 -
[LeetCode] 5. Longest Palindromic Substring
Description:Given a string s, find the longest palindromic substring in s. You may assume that the maximum length of s is 1000.Example:Input: "babad"Output: "bab"Note: "aba" is also a valid answer...原创 2018-03-24 23:48:25 · 122 阅读 · 0 评论 -
构造回文--最长回文子序列
Description:时间限制:1秒空间限制:32768K给定一个字符串s,你可以从中删除一些字符,使得剩下的串是一个回文串。如何删除才能使得回文串最长呢?输出需要删除的字符个数。输入描述:输入数据有多组,每组包含一个字符串s,且保证:1<=s.length<=1000. 输出描述:对于每组数据,输出一个整数,代表最少需要删除的字符个数。输入例子1:abcdagoogle输出例...原创 2018-03-24 23:02:27 · 174 阅读 · 0 评论 -
[LeetCode] 747. Min Cost Climbing Stairs
Problem:On a staircase, the i-th step has some non-negative cost cost[i] assigned (0 indexed).Once you pay the cost, you can either climb one or two steps. You need to find minimum cost to原创 2018-01-03 21:03:40 · 184 阅读 · 0 评论 -
[LeetCode] 646. Maximum Length of Pair Chain
Problem:You are given n pairs of numbers. In every pair, the first number is always smaller than the second number.Now, we define a pair (c, d) can follow another pair (a, b) if and only原创 2017-11-30 11:50:54 · 140 阅读 · 0 评论 -
[LeetCode] 416. Partition Equal Subset Sum
Problem:Given a non-empty array containing only positive integers, find if the array can be partitioned into two subsets such that the sum of elements in both subsets is equal.Note:Eac原创 2017-12-21 19:28:48 · 145 阅读 · 0 评论 -
[LeetCode] 494. Target Sum
Problem:You are given a list of non-negative integers, a1, a2, ..., an, and a target, S. Now you have 2 symbols + and -. For each integer, you should choose one from + and - as its new symbo原创 2017-12-21 20:36:16 · 143 阅读 · 0 评论 -
[LeetCode] 650. 2 Keys Keyboard
Problem:Initially on a notepad only one character 'A' is present. You can perform two operations on this notepad for each step:Copy All: You can copy all the characters present on the notepa原创 2017-12-13 22:34:08 · 201 阅读 · 0 评论 -
[LeetCode] 696. 计数二进制子串
题目描述:给定一个字符串 s,计算具有相同数量0和1的非空(连续)子字符串的数量,并且这些子字符串中的所有0和所有1都是组合在一起的。重复出现的子串要计算它们出现的次数。示例 1 :输入: "00110011"输出: 6解释: 有6个子串具有相同数量的连续1和0:“0011”,“01”,“1100”,“10”,“0011” 和 “01”。请注意,一些重复出现的子串要计算它们出现的次数。...原创 2018-04-13 14:07:25 · 650 阅读 · 0 评论