![](https://img-blog.csdnimg.cn/20201014180756925.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
leetcode
文章平均质量分 84
cuidiwhere
平静,持之以恒
展开
-
LeetCode2_Add Two Numbers
My answer 1. 第二遍提交 public ListNode addTwoNumbers(ListNode l1, ListNode l2) { if (l1 == null) { return l2; } if (l2 == null) { return l1; }原创 2015-01-06 06:54:52 · 895 阅读 · 0 评论 -
LeetCode1_Two Sum
My answer 第三遍提交 /** * running time : O(n) */ public int[] twoSum(int[] numbers, int target) { int[] result = new int[2]; HashMap map = new HashMap();原创 2015-01-06 07:15:06 · 1645 阅读 · 0 评论 -
LeetCode3_Longest Substring Without Repeating Characters
My Answer 1. 第三次提交 public int lengthOfLongestSubstring(String s) { if (s == null || s.length() == 0) { return 0; } int start = 0; int maxLength = 0;原创 2015-01-07 16:06:10 · 655 阅读 · 0 评论 -
LeetCode9_Palindrome Number
My answer /** * case1: x is negative, x is definitely not palindrome * case2: x is between 0 and 9, x is palindrome.included by case3 * case3: x has more than 1 digit. * A原创 2015-01-23 02:40:40 · 863 阅读 · 0 评论