JasonChang

  博客园  :: 首页  :: 新随笔  :: 联系 :: 订阅 订阅  :: 管理

2013年11月30日

摘要: 1 public class Solution { 2 public int[] twoSum(int[] numbers, int target) { 3 HashMap visited = new HashMap(); 4 int[] result = new int[2]; 5 for(int i = 0; i < numbers.length; i++){ 6 int tmp = target - numbers[i]; 7 if(visited.containsKey(tmp))... 阅读全文
posted @ 2013-11-30 14:29 JasonChang 阅读(128) 评论(0) 推荐(0) 编辑

摘要: 1 public class Solution { 2 public ListNode addTwoNumbers(ListNode l1, ListNode l2) { 3 if(l1 == null) 4 return l2; 5 if(l2 == null) 6 return l1; 7 ListNode fakehead = new ListNode(0); 8 ListNode pre = fakehead; 9 int carry = 0;10 ... 阅读全文
posted @ 2013-11-30 13:23 JasonChang 阅读(150) 评论(0) 推荐(0) 编辑