剑指 Offer 03. 数组中重复的数字 class Solution { public int findRepeatNumber(int[] nums) { int len = nums.length; int ans[] = new int[len]; for(int i = 0;i<len;i++) { ans[nums[i]] ++; if(ans[nums[i]]>1)return nums[i]; } return 0; } }