随笔分类 -  动态规划

摘要:https://leetcode.com/problems/distinct-subsequences/ Given a string S and a string T, count the number of distinct subsequences of T in S. A subsequen 阅读全文
posted @ 2017-01-06 19:52 牧马人夏峥 阅读(240) 评论(0) 推荐(0) 编辑
摘要:https://leetcode.com/problems/interleaving-string/ Given s1, s2, s3, find whether s3 is formed by the interleaving of s1 and s2. For example,Given:s1  阅读全文
posted @ 2016-12-30 11:14 牧马人夏峥 阅读(157) 评论(0) 推荐(0) 编辑
摘要:最长公共子序列不要求连续,最长公共子串要求连续。 参考:http://www.cnblogs.com/huangxincheng/archive/2012/11/11/2764625.html http://www.cnblogs.com/en-heng/p/3963803.html 在最长公共子序 阅读全文
posted @ 2016-12-23 11:25 牧马人夏峥 阅读(141) 评论(0) 推荐(0) 编辑
摘要:很经典的一道题,最长回文子串,有多种方法。 首先介绍的一种方法是从中间向两边展开。注意区分aba和abba型的回文串;如果当前最长的子串已经当于两边中最长的子串了,则无需再去判断。 //从中间向两边展开 string expandAroundCenter(string s, int c1, int 阅读全文
posted @ 2016-05-24 15:07 牧马人夏峥 阅读(168) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示