LeetCode-961 N-Repeated Element in Size 2N Array Solution (with Java)

1. Description: 

Notes:

2. Examples:

3.Solutions:

 1 /**
 2  * Created by sheepcore on 2019-02-24
 3  */
 4 class Solution {
 5     public int repeatedNTimes(int[] A) {
 6         int[] count = new int[10000];
 7         for(int i=0;i<A.length;i++)
 8             if(count[A[i]]++ == 1)
 9                 return A[i];
10             return -1;
11         }
12 }
原文地址:https://www.cnblogs.com/sheepcore/p/12395999.html