码迷,mamicode.com
首页 >  
搜索关键字:valid palindrome    ( 4264个结果
【leetcode】Valid Parentheses
Given a string containing just the characters'(',')','{','}','['and']', determine if the input string is valid.The brackets must close in the correct ...
分类:其他好文   时间:2014-07-22 22:52:56    阅读次数:222
uva 458 - The Decoder
The DecoderWrite a complete program that will correctly decode a set of characters into a valid message. Your program should read a given file of a si...
分类:其他好文   时间:2014-07-22 00:38:34    阅读次数:235
【leetcode刷题笔记】Valid Sudoku
Determine if a Sudoku is valid, according to:Sudoku Puzzles - The Rules.The Sudoku board could be partially filled, where empty cells are filled with ...
分类:其他好文   时间:2014-07-22 00:30:38    阅读次数:212
POJ 1159 Palindrome && HDU 1159 Common Subsequence
POJ 1159 Palindrome && HDU 1159 Common Subsequence...
分类:其他好文   时间:2014-07-21 23:27:29    阅读次数:249
动态规划第五讲——leetcode上的题目动态规划汇总(上)
本节,我们将对leetcode上有关DP问题的题目做一个汇总和分析。 1.题目来源 Interleaving String 动态规划 二叉树 Unique Binary Search Trees 动态规划 二叉树 Word Break 动态规划 N/A Word Break II 动态规划 N/A Palindrome Partitioning 动态规划 N/A ...
分类:其他好文   时间:2014-07-21 15:47:05    阅读次数:232
动态规划第五讲——leetcode上的题目动态规划汇总(上)
本节,我们将对leetcode上有关DP问题的题目做一个汇总和分析。 1.题目来源 Interleaving String 动态规划 二叉树 Unique Binary Search Trees 动态规划 二叉树 Word Break 动态规划 N/A Word Break II 动态规划 N/A Palindrome Partitioning 动态规划 N/A ...
分类:其他好文   时间:2014-07-21 15:21:05    阅读次数:189
LeetCode || Palindrome Number
Determine whether an integer is a palindrome. Do this without extra space. 判断一个int值是否为回文数。 本题有几点需要注意: (1)不能用额外存储空间,也就是说只能用常数空间解决;诸如将int转换为string再去比较字符是不可行的; (2)判断回文数的方法有两个:从中间开始向两头判断、从两头向中间判断;后者更简...
分类:其他好文   时间:2014-07-19 23:22:39    阅读次数:345
【leetcode刷题笔记】Validate Binary Search Tree
Given a binary tree, determine if it is a valid binary search tree (BST).Assume a BST is defined as follows:The left subtree of a node contains only n...
分类:其他好文   时间:2014-07-19 22:34:50    阅读次数:196
【leetcode刷题笔记】Palindrome Partitioning
Given a strings, partitionssuch that every substring of the partition is a palindrome.Return all possible palindrome partitioning ofs.For example, giv...
分类:其他好文   时间:2014-07-19 14:20:14    阅读次数:178
动态规划+滚动数组 -- POJ 1159 Palindrome
给一字符串,问最少加几个字符可以让它成为回文串 比如 Ab3bd 最少需要两个字符可以成为回文串 dAb3bAd 思路: 动态规划 DP[i][j] 意味着从 i 到 j 这段字符变为回文串最少要几个字符,枚举子串长。 if str[i] == str[j]: DP[i][j] = DP[i + 1][j - 1] else: DP[i][j] = min( DP[i +...
分类:其他好文   时间:2014-07-19 02:35:45    阅读次数:198
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!