摘要: Given an index k, return the kth row of the Pascal's triangle. For example, given k = 3,Return[1,3,3,1]. Note:Could you optimize your algorithm to use 阅读全文
posted @ 2016-09-01 14:26 googlemeoften 阅读(146) 评论(0) 推荐(0) 编辑
摘要: Given a triangle, find the minimum path sum from top to bottom. Each step you may move to adjacent numbers on the row below. For example, given the fo 阅读全文
posted @ 2016-09-01 14:08 googlemeoften 阅读(135) 评论(0) 推荐(0) 编辑
摘要: 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-09-01 13:15 googlemeoften 阅读(209) 评论(0) 推荐(0) 编辑
摘要: 题目:给定一个字符串s,你可以从中删除一些字符,使得剩下的串是一个回文串。如何删除才能使得回文串最长呢?输出需要删除的字符个数。 思路:该题目可以先将字符串s倒序然后求倒序字符串与原来字符串的最长公共子序列(动态规划:dp[i][j] 表示的是Str1[0...i] 与 Str2[0...j] 的最 阅读全文
posted @ 2016-09-01 11:11 googlemeoften 阅读(280) 评论(0) 推荐(0) 编辑