Class Solution

  • All Implemented Interfaces:

    
    public final class Solution
    
                        

    1925 - Count Square Sum Triples\.

    Easy

    A square triple (a,b,c) is a triple where a, b, and c are integers and <code>a<sup>2</sup> + b<sup>2</sup> = c<sup>2</sup></code>.

    Given an integer n, return the number of square triples such that 1 &lt;= a, b, c &lt;= n.

    Example 1:

    Input: n = 5

    Output: 2

    Explanation: The square triples are (3,4,5) and (4,3,5).

    Example 2:

    Input: n = 10

    Output: 4

    Explanation: The square triples are (3,4,5), (4,3,5), (6,8,10), and (8,6,10).

    Constraints:

    • 1 &lt;= n &lt;= 250

    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
    • Field Summary

      Fields 
      Modifier and Type Field Description
    • Constructor Summary

      Constructors 
      Constructor Description
      Solution()
    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
    • Method Summary

      Modifier and Type Method Description
      final Integer countTriples(Integer n)
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait