Given a string containing only digits, restore it by returning all possible valid IP address combinations.For example:Given"25525511135",return["255.2...
分类:
其他好文 时间:
2014-07-26 00:05:16
阅读次数:
301
Valid PalindromeGiven a string, determine if it is a palindrome, considering only alphanumeric characters and ignoring cases.For example,"A man, a pla...
分类:
其他好文 时间:
2014-07-25 23:52:10
阅读次数:
202
很多时候我们使用hibernate的session时,都是让session在 某一运行环境中保持其唯一。例如在同一线程内用同一个session,在同一方法内用同一session,这样我们就可以用session里面缓存好的数 据。但,我想说的不是缓存,且听我一一道来。 最近试用spring3.0.2....
分类:
数据库 时间:
2014-07-25 16:32:41
阅读次数:
248
Valid ParenthesesGiven a string containing just the characters'(',')','{','}','['and']', determine if the input string is valid.The brackets must clos...
分类:
其他好文 时间:
2014-07-24 21:42:52
阅读次数:
187
Given a string containing just the characters'('and')', find the length of the longest valid (well-formed) parentheses substring.For"(()", the longest...
分类:
其他好文 时间:
2014-07-24 12:11:55
阅读次数:
253
Validate if a given string is numeric.Some examples:"0"=>true" 0.1 "=>true"abc"=>false"1 a"=>false"2e10"=>true题解:题目不难,就是有点麻烦,要注意的地方很多,总结一下:前面和后面的空格要用s...
分类:
其他好文 时间:
2014-07-23 20:43:55
阅读次数:
222
Description:Given a strings, partitionssuch that every substring of the partition is a palindrome.Return the minimum cuts needed for a palindrome part...
分类:
其他好文 时间:
2014-07-23 20:34:35
阅读次数:
235
题目链接题意 :给你一个字符串,让你删除或添加某些字母让这个字符串变成回文串,删除或添加某个字母要付出相应的代价,问你变成回文所需要的最小的代价是多少。思路 :DP[i][j]代表的是 i 到 j 这一段位置变成回文所需的最小的代价。 1 //3280 2 #include 3 #include ....
分类:
其他好文 时间:
2014-07-22 22:46:35
阅读次数:
217
一:添加字段:ALTER TABLE `jifen_gather` ADD `lo_baidu_valid_uv` INT( 11 ) NOT NULL DEFAULT '0' COMMENT '有效的百度搜索uv' AFTER `lo_baidu_no_xiala` ;
分类:
数据库 时间:
2014-07-22 22:36:56
阅读次数:
240
题目大意:给定一个字符串,求最少插入几个字符让该字符串成为回文串
法一:
dp[i][j]表示使区间[i,j]成为回文串最小插入的字符数,则状态转移方程
1、if s[i]==s[len-1] 则:d[i][j]=d[i+1][j-1]
2、else d[i]=min(dp[i+1][j],dp[i][j-1])
首尾字符不同的时候,有两种决策。
1、将新字符插在首位,那么状态就...
分类:
其他好文 时间:
2014-07-21 23:30:01
阅读次数:
255