2015年6月14日

摘要: 1 题目:Write a function to find the longest common prefix string amongst an array of strings.Hide TagsString2 思路所有字符串公共的前缀,那么第一个字符串肯定包括了。 从第一个字符串开始遍历着手即... 阅读全文
posted @ 2015-06-14 15:19 聆听V风声 阅读(205) 评论(0) 推荐(0) 编辑

2015年6月10日

摘要: 1 题目:Given a roman numeral, convert it to an integer.Input is guaranteed to be within the range from 1 to 3999.2 思路和上一道反过来,好吧,但是思路不一样。我写的代码思路一样,要考虑一些特... 阅读全文
posted @ 2015-06-10 20:27 聆听V风声 阅读(149) 评论(0) 推荐(0) 编辑
 
摘要: 1 题目:Given an integer, convert it to a roman numeral.Input is guaranteed to be within the range from 1 to 3999.Hide TagsMathString2 思路:经过我仔细研读维基百科的说明h... 阅读全文
posted @ 2015-06-10 18:47 聆听V风声 阅读(240) 评论(0) 推荐(0) 编辑
 
摘要: 1 题目:Givennnon-negative integersa1,a2, ...,an, where each represents a point at coordinate (i,ai).nvertical lines are drawn such that the two endpoint... 阅读全文
posted @ 2015-06-10 16:22 聆听V风声 阅读(166) 评论(0) 推荐(0) 编辑
 
摘要: 1 题目:Implement regular expression matching with support for'.'and'*'.'.' Matches any single character.'*' Matches zero or more of the preceding elemen... 阅读全文
posted @ 2015-06-10 11:56 聆听V风声 阅读(750) 评论(0) 推荐(0) 编辑

2015年6月7日

摘要: 1 题目:Determine whether an integer is a palindrome. Do this without extra space.click to show spoilers.Some hints:Could negative integers be palindrome... 阅读全文
posted @ 2015-06-07 21:13 聆听V风声 阅读(181) 评论(0) 推荐(0) 编辑

2015年6月6日

摘要: 1 题目:Implementatoito convert a string to an integer.Hint:Carefully consider all possible input cases. If you want a challenge, please do not see below... 阅读全文
posted @ 2015-06-06 14:54 聆听V风声 阅读(105) 评论(0) 推荐(0) 编辑

2015年6月5日

摘要: 1 题目: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 fo... 阅读全文
posted @ 2015-06-05 16:32 聆听V风声 阅读(123) 评论(0) 推荐(0) 编辑
 
摘要: 1 题目:Given a stringS, find the longest palindromic substring inS. You may assume that the maximum length ofSis 1000, and there exists one unique longe... 阅读全文
posted @ 2015-06-05 14:53 聆听V风声 阅读(149) 评论(0) 推荐(0) 编辑

2015年5月20日

摘要: 1 题目Given an array withnobjects colored red, white or blue, sort them so that objects of the same color are adjacent, with the colors in the order red... 阅读全文
posted @ 2015-05-20 23:22 聆听V风声 阅读(136) 评论(0) 推荐(0) 编辑