尾动态规划 最长不重复连续w子串.docVIP

  • 6
  • 0
  • 约5.39千字
  • 约 6页
  • 2016-12-25 发布于湖南
  • 举报
动态规划 最长不重复连续子串 分类: ACM2011-11-10 22:39 198人阅读 评论(0) 收藏 举报 题意 Longest Substring Without Repeating Characters Given a string, find the length of the longest substring without repeating characters. For example, the longest substring without repeating letters for abcabcbb is abc, which the length is 3. For bbbbb the longest substring is b, with the length of 1. 这个题是在LeetCode上面看到的。想到是用动态规划来做。但是具体如何推导没有想出来。 后来看了一下别人的思路,整理一下。写个总结。, 题意很简单,就是给定一个字符串,找到其中出现了的最长不重复子串。 比如abcc就是abc abcdcdefg就是cdefg。 动态规划 我的动态规划一直学得比较挫。这里也是借他山之石。 [cpp] view plaincopy int lengthOfLongestSubstring(string s) { const

您可能关注的文档

文档评论(0)

1亿VIP精品文档

相关文档