两数之和:力扣top1
class Solution {
//思路:直接往map里加,当什么时候不加了呢,当集合里面出现target-添加进集合里面的值的时候,就可以不加了。
//java.util.HashMap; HashMap.get(key) HashMap.put(key,value) 返回匿名数组:new int[]{ xx,xxx}
//throw new RunTimeException("没有找到数据")
public int[] twoSum(int[] nums, int t.
转载
2020-09-14 15:28:09 ·
73 阅读 ·
0 评论