Problem Statement |
| An integer b is a bisquare if two (possibly equal) integers x and y exist such that x2 + y2 = b. Given two ints, low and high, return the number of distinct bisquares between low and high, inclusive. |
|
Definition |
| Class: | BisquareSums | Method: | getSums | Parameters: | int, int | Returns: | int | Method signature: | int getSums(int low, int high) | (be sure your method is public) |
|
|
|
|
Constraints |
- | low will be between 1 and 100, inclusive. |
- | high will be between low and 100, inclusive. |
|
Examples |
0) | |
| | Returns: 4 | 02 + 12 = 1
02 + 22 = 4
12 + 12 = 2
12 + 22 = 5 |
|
|
1) | |
| |
2) | |
| |
3) | |
| |