Count Square Sum Triples Problem

Count Square Sum Triples Problem — ExecCode Easy DSA Practice

Solve the Count Square Sum Triples problem on ExecCode. Free online easy DSA practice in Math. Write and run code in Java, C++, Python — no signup required to run.

Problem description

Description You are given an integer n, return the number of square triples such that 1 <= a, b, c <= n. Your task is to a square triple (a,b,c) is a triple where a, b, and c are integers and a^2 + b^2 = c^2. Return the required answer exactly as shown in the examples.

Examples

Input {"n": 5}; Output 2. Input {"n": 10}; Output 4

Constraints

1 <= n <= 250

Practice Count Square Sum Triples free on ExecCode. Browse DSA problems, topic map, and placement guides.