摘要:
[Problem]Write a function to find the longest common prefix string amongst an array of strings.[Analysis]思路非常简单,循环验证每一个字符串就可以通过OJ,代码也没有优化。[Solution]pu... 阅读全文
摘要:
[Problem]Given a roman numeral, convert it to an integer.Input is guaranteed to be within the range from 1 to 3999.[Analysis]建立一个字符到数字的map之后只需要抓住两个条件:... 阅读全文
摘要:
[Problem]Given an integer, convert it to a roman numeral.Input is guaranteed to be within the range from 1 to 3999.[Analysis]由于题目提示输入的范围是1至3999,这题我采用了... 阅读全文
摘要:
[Problem]Givennnon-negative integersa1,a2, ...,an, where each represents a point at coordinate (i,ai).nvertical lines are drawn such that the two endp... 阅读全文
摘要:
[Problem]Implement regular expression matching with support for'.'and'*'.'.' Matches any single character.'*' Matches zero or more of the preceding el... 阅读全文
摘要:
[Problem]Determine whether an integer is a palindrome. Do this without extra space.[Analysis]这题不能转换为String来做因为要求constant space。只要依次比较头尾两个数字就可以了。[Solut... 阅读全文
摘要:
[Problem]Implementatoito convert a string to an integer.Hint:Carefully consider all possible input cases. If you want a challenge, please do not see b... 阅读全文
摘要:
[Problem]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 fixe... 阅读全文
摘要:
[Problem]Given a stringS, find the longest palindromic substring inS. You may assume that the maximum length ofSis 1000, and there exists one unique l... 阅读全文