2014年5月19日
摘要: Reverse digits of an integer. Example1: x = 123, return 321 Example2: x = -123, return –321 这道题应该不用详细说了。比较简单。唯一的是要注意特殊值0. public class Solution { public int reverse(int x) { ... 阅读全文
posted @ 2014-05-19 14:04 JessiaDing 阅读(88) 评论(0) 推荐(0) 编辑
摘要: The string "PAYPALISHIRING" is written in a zigzag pattern on a given number of rows like this: (you may want to display this pattern in a fixed font for better legibility) P A H N A P L S... 阅读全文
posted @ 2014-05-19 13:50 JessiaDing 阅读(197) 评论(0) 推荐(0) 编辑
摘要: Given a string S, find the longest palindromic substring in S. You may assume that the maximum length of S is 1000, and there exists one unique longest palindromic substring. 首先,所谓回文,其实就是反过来和原来的字符串一样... 阅读全文
posted @ 2014-05-19 12:30 JessiaDing 阅读(107) 评论(0) 推荐(0) 编辑