ARTS_第一周挑战

  1. Algorithm:每周至少做一个 leetcode 的算法题

    TwoSum题目
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
class Solution {
public int[] twoSum(int[] nums, int target) {
Map<Integer, Integer> map = new HashMap<>();
for (int i = 0; i < nums.length; i++) {
map.put(nums[i], i);
}

int complement ;
for (int i = 0; i < nums.length; i++) {
complement = target - nums[i];
if (map.containsKey(complement) && map.get(complement) != i) {
return new int[] { i, map.get(complement) };
}
}
return null;
}
}
  1. Review:阅读并点评至少一篇英文技术文章

    自己翻译练习的Effective Java (注:翻译水平很有限,欢迎大家指正)
    Effective Java Introduction

  2. Tip:学习至少一个技术技巧

    markdown语法学习

  3. Share:分享一篇有观点和思考的技术文章

    这篇文章是带我第一次引起我看源码的文章,纪念一下
    hashMap源码