java.lang.Object
g1901_2000.s1925_count_square_sum_triples.Solution

public class Solution extends Object
1925 - Count Square Sum Triples.<p>Easy</p> <p>A <strong>square triple</strong> <code>(a,b,c)</code> is a triple where <code>a</code>, <code>b</code>, and <code>c</code> are <strong>integers</strong> and <code>a<sup>2</sup> + b<sup>2</sup> = c<sup>2</sup></code>.</p> <p>Given an integer <code>n</code>, return <em>the number of <strong>square triples</strong> such that</em> <code>1 <= a, b, c <= n</code>.</p> <p><strong>Example 1:</strong></p> <p><strong>Input:</strong> n = 5</p> <p><strong>Output:</strong> 2</p> <p><strong>Explanation:</strong> The square triples are (3,4,5) and (4,3,5).</p> <p><strong>Example 2:</strong></p> <p><strong>Input:</strong> n = 10</p> <p><strong>Output:</strong> 4</p> <p><strong>Explanation:</strong> The square triples are (3,4,5), (4,3,5), (6,8,10), and (8,6,10).</p> <p><strong>Constraints:</strong></p> <ul> <li><code>1 <= n <= 250</code></li> </ul>
  • Constructor Details

    • Solution

      public Solution()
  • Method Details

    • countTriples

      public int countTriples(int n)