2016年5月26日

Palindrome Partitioning II

摘要: Given a string s, partition s such that every substring of the partition is a palindrome. Return the minimum cuts needed for a palindrome partitioning 阅读全文

posted @ 2016-05-26 22:16 Sheryl Wang 阅读(129) 评论(0) 推荐(0) 编辑

Longest Common Substring

摘要: 给出两个字符串,找到最长公共子串,并返回其长度。 注意事项 子串的字符应该连续的出现在原字符串中,这与子序列有所不同。 Lintcode上的一道题目,非常经典,需要找到最长的连续公共子串的长度。 因为有两个序列且前后顺序不可以打乱,所以为双序列问题。 这种问题比较重要的是定义状态。这里将状态f[i] 阅读全文

posted @ 2016-05-26 15:37 Sheryl Wang 阅读(173) 评论(0) 推荐(0) 编辑

Longest Increasing Subsequence

摘要: Given an unsorted array of integers, find the length of longest increasing subsequence. For example,Given [10, 9, 2, 5, 3, 7, 101, 18],The longest inc 阅读全文

posted @ 2016-05-26 14:43 Sheryl Wang 阅读(122) 评论(0) 推荐(0) 编辑

导航