2015年9月10日

摘要: Write a function to find the longest common prefix string amongst an array of strings. 1 string longestCommonPrefix(vector& strs) { 2 int i=0,... 阅读全文
posted @ 2015-09-10 15:05 怕忘记 阅读(166) 评论(0) 推荐(0) 编辑
 
摘要: Given an integer, convert it to a roman numeral.Input is guaranteed to be within the range from 1 to 3999. 1 string intToRoman(int num) { 2 ... 阅读全文
posted @ 2015-09-10 15:04 怕忘记 阅读(115) 评论(0) 推荐(0) 编辑
 
摘要: Givennnon-negative integersa1,a2, ...,an, where each represents a point at coordinate (i,ai).nvertical lines are drawn such that the two endpoints of ... 阅读全文
posted @ 2015-09-10 15:03 怕忘记 阅读(125) 评论(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 fo... 阅读全文
posted @ 2015-09-10 14:48 怕忘记 阅读(116) 评论(0) 推荐(0) 编辑

2015年9月7日

摘要: Determine whether an integer is a palindrome. Do this without extra space.click to show spoilers.Some hints:Could negative integers be palindromes? (i... 阅读全文
posted @ 2015-09-07 22:20 怕忘记 阅读(106) 评论(0) 推荐(0) 编辑
 
摘要: Implementatoito convert a string to an integer.Hint:Carefully consider all possible input cases. If you want a challenge, please do not see below and ... 阅读全文
posted @ 2015-09-07 22:19 怕忘记 阅读(115) 评论(0) 推荐(0) 编辑
 
摘要: Reverse digits of an integer.Example1:x = 123, return 321Example2:x = -123, return -321click to show spoilers.Have you thought about this?Here are som... 阅读全文
posted @ 2015-09-07 22:18 怕忘记 阅读(144) 评论(0) 推荐(0) 编辑
 
摘要: Given a stringS, find the longest palindromic substring inS. You may assume that the maximum length ofSis 1000, and there exists one unique longest pa... 阅读全文
posted @ 2015-09-07 22:16 怕忘记 阅读(146) 评论(0) 推荐(0) 编辑
 
摘要: Given a string, find the length of the longest substring without repeating characters. For example, the longest substring without repeating letters fo... 阅读全文
posted @ 2015-09-07 22:14 怕忘记 阅读(138) 评论(0) 推荐(0) 编辑
 
摘要: You are given two linked lists representing two non-negative numbers. The digits are stored in reverse order and each of their nodes contain a single ... 阅读全文
posted @ 2015-09-07 19:46 怕忘记 阅读(126) 评论(0) 推荐(0) 编辑