Chinaunix首页 | 论坛 | 博客
  • 博客访问: 117069
  • 博文数量: 53
  • 博客积分: 0
  • 博客等级: 民兵
  • 技术积分: 620
  • 用 户 组: 普通用户
  • 注册时间: 2014-08-24 16:22
文章存档

2014年(53)

我的朋友

发布时间:2014-09-18 15:36:24

Given a string s, partition s such that every substring of the partition is a palindrome.Return all possible palindrome partitioning of s.For example, given s = "aab",Return [ ["aa","b"],.........【阅读全文】

阅读(749) | 评论(0) | 转发(0)

发布时间:2014-09-18 10:06:09

Determine whether an integer is a palindrome. Do this without extra space.click to show spoilers.Some hints:Could negative integers be palindromes? (ie, -1)If you are thinking of converting the integer to string, note the restriction of using extra space.You could also t.........【阅读全文】

阅读(706) | 评论(0) | 转发(0)

发布时间:2014-09-18 09:42:39

Given a string, determine if it is a palindrome, considering only alphanumeric characters and ignoring cases.For example,"A man, a plan, a canal: Panama" is a palindrome."race a car" is not a palindrome.Note:Have you consider that the string might be empty? This is a.........【阅读全文】

阅读(864) | 评论(0) | 转发(0)

发布时间:2014-09-16 16:19:17

我们先研究一下这个问题,判断一个字符串s3是否由给定的字符串s1和s2交错而成:由于s1和s2中可能有相同的字符,所以无法通过遍历s3得出结论。那看一下是否有最优子结构?也就是说,问题的解是否可以由子问题的解推导出来。假设s3的长度为l3,首先想到的是result[l3]=result[l3-1]&&(s3[l3-1]在s1或s2中);后.........【阅读全文】

阅读(689) | 评论(0) | 转发(0)

发布时间:2014-09-06 13:50:01

A message containing letters from A-Z is being encoded to numbers using the following mapping:'A' -> 1'B' -> 2...'Z' -> 26Given an encoded message containing digits, determine the total number of ways to decode it.For example,Given encoded message "12", it could be dec.........【阅读全文】

阅读(876) | 评论(0) | 转发(0)
给主人留下些什么吧!~~
留言热议
请登录后留言。

登录 注册