LeetCode 1925. Count Square Sum Triples1925. Count Square Sum Triples Posted on 2021-07-11 Edited on 2024-11-24 In LeetCode 123456789101112class Solution {public: int countTriples(int n) { int ans = 0; for (int a = 1; a <= n; ++a) for (int b = 1; b <= n; ++b) for (int c = 1; c <= n; ++c) if (a * a + b * b == c * c) ++ans; return ans; }};