<awangdev>287. Find the Duplicate Number_2.java
private boolean validate(int candidate, int[] nums) {

        int count = 0;
        for (int num: nums) {
            count += num <= candidate ? 1 : 0;
        }
        return count <= candidate;
    }
private boolean var_0 ( int var_1 , int [ ] var_2 ) {
  int var_4 = 0 ;
  for ( int var_5 : var_2 ) {
    var_4 += var_5 <= var_1 ? 1 : 0 ;
  }
  return var_4 <= var_1 ;
}
