随笔分类 - leetcode
摘要:这是一道经典的动态规划题最长递增子序列问题:在一列数中寻找一些数,这些数满足:任意两个数a[i]和a[j],若i<j,必有a[i]<a[j],这样最长的子序列称为最长递增子序列。 设dp[i]表示以i为结尾的最长递增子序列的长度,则状态转移方程为:dp[i] = max{dp[j]+1}, 1<=j
阅读全文
摘要:321. Create Maximum Number 题目描述 Given two arrays of length and with digits representing two numbers. Create the maximum number of length `k maxArray(v
阅读全文
摘要:本文转自:http://www.cnblogs.com/TenosDoIt/p/3675788.html 题目链接 Given a string S, find the longest palindromic substring in S. You may assume that the maxim
阅读全文
摘要:Given a m x n grid filled with non-negative numbers, find a path from top left to bottom right which minimizes the sum of all numbers along its path.
阅读全文