package leetcode;

/**
 * https://leetcode.com/problems/count-square-sum-triples/
 */
public class Problem1925 {
    public int countTriples(int n) {
        // TODO
        return 0;
    }

    public static void main(String[] args) {
        Problem1925 prob = new Problem1925();
        System.out.println(prob.countTriples(5)); // 2
        System.out.println(prob.countTriples(10)); // 4
    }
}

@@ -12,16 +12,65 @@
 tcode;%0A%0A
+import java.util.HashSet;%0Aimport java.util.Set;%0A%0A
 /**%0A * h
@@ -204,242 +204,463 @@
     
-// TODO%0A        return 0;%0A
+Set%3C/* square */ Integer%3E squares = new HashSet%3C%3E();%0A        for (int i = 1; i %3C= n; i++) %7B%0A            squares.add(i * i);%0A   
     
+ 
 %7D
-%0A
 %0A    
-public static void main(String%5B%5D args) %7B%0A        Problem1925 pro
+    int answer = 0;%0A        for (int a = 1; a %3C= n; a++) %7B%0A            for (int b = 2; 
 b 
+%3C
 = n
-ew Problem1925();%0A        System.out.println(prob
+; b++) %7B%0A                // a%5E2 + b%5E2 = c%5E2%0A                int c = (a * a) + (b * b);%0A                if (squares
 .co
-u
 nt
-Triples(5)); // 2%0A        System.out.println(prob.countTriples(10)); // 4
+ains(c)) %7B%0A                    answer++;%0A                %7D%0A            %7D%0A        %7D%0A        return answer;
 %0A   

Solve problem 1925