回文字符序列
摘要:转载http://blog.csdn.net/u014800748/article/details/451484411、问题描述描述给定字符串,求它的回文子序列个数。回文子序列反转字符顺序后仍然与原序列相同。例如字符串aba中,回文子序列为"a", "a", "aa", "b", "aba",共5个...
阅读全文
动态规划求一个序列的最长回文子序列(Longest Palindromic Substring )
摘要:1、问题描述给定一个字符串(序列),求该序列的最长的回文子序列。2、分析需要理解的几个概念:---回文---子序列---子串http://www.cnblogs.com/LCCRNblog/p/4321398.html这一篇文章描述了利用动态规划求解两个序列的最长公共子序列(Longest Comm...
阅读全文
统计闰年2月29日天数
摘要:1.问题描述描述给定两个日期,计算这两个日期之间有多少个2月29日(包括起始日期)。只有闰年有2月29日,满足以下一个条件的年份为闰年:1. 年份能被4整除但不能被100整除2. 年份能被400整除输入第一行为一个整数T,表示数据组数。之后每组数据包含两行。每一行格式为"month day, yea...
阅读全文
Leetcode 172 Factorial Trailing Zeroes
摘要:1、题目要求Given an integern, return the number of trailing zeroes inn!.Note:Your solution should be in logarithmic time complexity.题目意思是求n的阶乘后面末尾0的个数,并且时间...
阅读全文
Leetcode 199 Binary Tree Right Side View
摘要:1.题目要求Given a binary tree, imagine yourself standing on therightside of it, return the values of the nodes you can see ordered from top to bottom.For ...
阅读全文
Leetcode 198 House Robber
摘要:1.题目要求You are a professional robber planning to rob houses along a street. Each house has a certain amount of money stashed, the only constraint stopp...
阅读全文