@Test(timeout = 200) public void randomTest() { Random r = new Random(); for (int w = 0; w < 20; w++) { int N = 100000; int[] A = new int[N]; for (int i = 0; i < N; i++) { A[i] = i; } int k = r.nextInt(10), idx = 0; int[] expect = new int[k]; for (int i = 0; i < k; i++) { expect[i] = r.nextInt(N); for (int j = 0; j < N / 10 + 1; j++) { A[idx++] = expect[i]; } } shuffle(A); Arrays.sort(expect); int[] res = DecimalDominants.getEleOccurMoreThanOneOfTen(A); Arrays.sort(res); System.out.println(Arrays.toString(expect)); Assert.assertArrayEquals(expect, res); } }
public static int[] getEleOccurMoreThanOneOfTen(int[] arr) { return convertToIntArray(getOccurMoreThanOneOfK(arr, 10)); }
DecimalDominants { public static int[] getEleOccurMoreThanOneOfTen(int[] arr) { return convertToIntArray(getOccurMoreThanOneOfK(arr, 10)); } }
DecimalDominants { public static int[] getEleOccurMoreThanOneOfTen(int[] arr) { return convertToIntArray(getOccurMoreThanOneOfK(arr, 10)); }  }
DecimalDominants { public static int[] getEleOccurMoreThanOneOfTen(int[] arr) { return convertToIntArray(getOccurMoreThanOneOfK(arr, 10)); }  static int[] getEleOccurMoreThanOneOfTen(int[] arr); }
DecimalDominants { public static int[] getEleOccurMoreThanOneOfTen(int[] arr) { return convertToIntArray(getOccurMoreThanOneOfK(arr, 10)); }  static int[] getEleOccurMoreThanOneOfTen(int[] arr);  }