<awangdev>611. Valid Triangle Number_1.java
public int triangleNumber(int[] nums) {
        
        Arrays.sort(nums);
        int n = nums.length, count = 0;
        for (int k = n - 1; k >= 2; k--) { 
            for (int i = 0, j = k - 1; i < j;) { 
                if (nums[i] + nums[j] > nums[k]) {
                    count += j - i;
                    j--; 
                } else i++; 
            }
        }
        return count;
    }
public int sample_funcname ( int [ ] var_0 ) {
  Arrays . sort ( var_0 ) ;
  int var_4 = var_0 . length , var_6 = 0 ;
  for ( int var_8 = var_4 - 1 ;
  var_8 >= 2 ;
  var_8 -- ) {
    for ( int var_10 = 0 , var_11 = var_8 - 1 ;
    var_10 < var_11 ;
    ) {
      if ( var_0 [ var_10 ] + var_0 [ var_11 ] > var_0 [ var_8 ] ) {
        var_6 += var_11 - var_10 ;
        var_11 -- ;
      }
      else var_10 ++ ;
    }
  }
  return var_6 ;
}
