LeetCode
豆奶冲啊
这个作者很懒,什么都没留下…
展开
-
JAVA的leetcode刷题
Leetcode 刷题 牛客网的剑指offer 题目:在一个长度为n的数组所有数字在 0到N-1范围内,数组中某些数字重复,但不知道几个重复,也不知重复几次,找出数组中任一重复数字 public static boolean duplicate(int[] nums,int length,int[] duplication) { if(nums==null||length<=0) return false; for(int i=0;i<length;i++)原创 2020-06-12 16:56:49 · 121 阅读 · 0 评论 -
java的LeetCode题目代码
TwoSum 给定数组,给定目标,数组中 两数相加=目标,返回两数下标。 方法一 public static void TwoSum(int[] nums, int target) { Map<Integer,Integer> map=new HashMap<>(); for(int i=0;i<nums.length;i++){ Integer index=map.get(target-nums[i]);原创 2020-06-01 20:56:49 · 82 阅读 · 0 评论