1925. Count Square Sum Triples Easy
1/**
2 * [1925] Count Square Sum Triples
3 *
4 * A square triple (a,b,c) is a triple where a, b, and c are integers and a^2 + b^2 = c^2.
5 * Given an integer n, return the number of square triples such that 1 <= a, b, c <= n.
6 *
7 * Example 1:
8 *
9 * Input: n = 5
10 * Output: 2
11 * Explanation: The square triples are (3,4,5) and (4,3,5).
12 *
13 * Example 2:
14 *
15 * Input: n = 10
16 * Output: 4
17 * Explanation: The square triples are (3,4,5), (4,3,5), (6,8,10), and (8,6,10).
18 *
19 *
20 * Constraints:
21 *
22 * 1 <= n <= 250
23 *
24 */
25pub struct Solution {}
26
27// problem: https://leetcode.com/problems/count-square-sum-triples/
28// discuss: https://leetcode.com/problems/count-square-sum-triples/discuss/?currentPage=1&orderBy=most_votes&query=
29
30// submission codes start here
31
32impl Solution {
33 pub fn count_triples(n: i32) -> i32 {
34 0
35 }
36}
37
38// submission codes end
39
40#[cfg(test)]
41mod tests {
42 use super::*;
43
44 #[test]
45 fn test_1925() {
46 }
47}
48
Back
© 2025 bowen.ge All Rights Reserved.