package leetcode;

/**
 * https://leetcode.com/problems/valid-triangle-number/
 */
public class Problem611 {
    public int triangleNumber(int[] nums) {
        // TODO
        return 0;
    }

    public static void main(String[] args) {
        Problem611 prob = new Problem611();
        System.out.println(prob.triangleNumber(new int[]{2, 2, 3, 4})); // 3
    }
}

@@ -12,16 +12,42 @@
 tcode;%0A%0A
+import java.util.Arrays;%0A%0A
 /**%0A * h
@@ -184,206 +184,468 @@
     
-// TODO%0A        return 0
+int result = 0;%0A        Arrays.sort(nums)
 ;%0A    
-%7D%0A%0A
     
-public static void main(String%5B%5D args) %7B%0A        Problem611 prob = new Problem611();%0A        System.out.println(prob.triangleNumber(new int%5B%5D%7B2, 2, 3, 4%7D)); // 3
+for (int i = 0; i %3C nums.length; i++) %7B%0A            for (int j = i + 1; j %3C nums.length; j++) %7B%0A                int k = j + 1;%0A                for (; k %3C nums.length; k++) %7B%0A                    if (nums%5Bi%5D + nums%5Bj%5D %3E nums%5Bk%5D) %7B%0A                        result++;%0A                    %7D else %7B%0A                        break;%0A                    %7D%0A                %7D%0A            %7D%0A        %7D%0A        return result;
 %0A   

Solve problem 611