- 博客(6)
- 收藏
- 关注
原创 Leetcode_009_Palindrome_Number
public class Solution { public boolean isPalindrome(int x) { if(x<0 || (x!=0 && x%10 == 0)) return false; int result = 0; while(x>result){ result = result*10+x%
2017-01-06 09:42:51 236
原创 leetcode_007_Reverse_Intege
public class Solution { public int reverse(int x) { int result = 0; int previous = 0; while(x!=0){ previous = result; result = result * 10 + x%10;
2017-01-06 09:10:03 345
原创 Leetcode_005_Longest_Palindromic_Substring
public class Solution { public String longestPalindrome(String s) { String result = ""; if(s.length() == 1) return s; for(int i = 0; i<s.length()-1; i++){ Strin
2017-01-06 08:25:43 211
原创 Leetcode_003_Longest_Substring_Without_Repeating_Characters
public class Solution { public int lengthOfLongestSubstring(String s) { int result = Integer.MIN_VALUE; int len = s.length(); if(len == 0 || len == 1) return len;
2017-01-06 07:31:57 324
原创 Leetcode_002_Add_Two_Numbers
/** * Definition for singly-linked list. * public class ListNode { * int val; * ListNode next; * ListNode(int x) { val = x; } * } */ public class Solution { public ListNode addT
2017-01-06 06:54:37 269
原创 Leetcode_001_Two_Sum
public class Solution { public int[] twoSum(int[] nums, int target) { int []result = new int[2]; HashMap hm = new HashMap(); for(int i = 0; i<nums.length; i++){
2017-01-06 05:00:48 231
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人