- 博客(5)
- 资源 (3)
- 收藏
- 关注
原创 leetcode 13. Roman to Integer
题目Given a roman numeral, convert it to an integer. Input is guaranteed to be within the range from 1 to 3999.解class Solution { public int romanToInt(String s) { HashMap<Character,Integer>
2018-01-07 15:52:45 295
原创 leetcode 9. Palindrome Number
题目Determine whether an integer is a palindrome. Do this without extra space.解class Solution { public boolean isPalindrome(int x) { if(x<0) return false; int y=x; int res=0;
2018-01-07 15:34:35 280
原创 leetcode 14. Longest Common Prefix
题目Write a function to find the longest common prefix string amongst an array of strings.解class Solution { public String longestCommonPrefix(String[] strs) { //return ""; if(s
2018-01-07 15:29:42 287
原创 leetcode 7.Reverse Integer
题目Given a 32-bit signed integer, reverse digits of an integer.Example 1:Input: 123 Output: 321 Example 2:Input: -123 Output: -321 Example 3:Input: 120 Output: 21 Note: Assume we are dealing wit
2018-01-03 22:39:46 302
原创 leetcode 1.Two Sum
题目Given an array of integers, return indices of the two numbers such that they add up to a specific target.You may assume that each input would have exactly one solution, and you may not use the same e
2018-01-02 20:23:12 228
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人