150. Pythagorean Triplets
MediumBrute Force
Count triplets a < b < c ≤ n with a² + b² = c².
Input format
A single integer n.
Output format
The count.
Example 1
Input
5
Output
1
Example 2
Input
4
Output
0
Constraints
1 ≤ n ≤ 2000
Read input from standard input and print the answer to standard output. Your code is judged against 5 test cases, most of them hidden.
Loading the MyLoginn IDE…