2022-09-12-1608-特殊数组的特征值

1 · zhuba-Ahhh · Sept. 12, 2022, 2:21 a.m.
1608.特殊数组的特征值暴力JAVA12345678910111213class Solution { public int specialArray(int[] nums) { Arrays.sort(nums); for (int i = 0; i <= nums.length; i++) { int count = 0; for (int j = 0; j < nums.length; j++) { if (nums[j] >= i) count++; } if (count == i) return i; } return -class Solution { public int specialArray(int[] nums) { Arrays.sort(nums); for (int i = 0; i <= nums.length; i++) { ...