Count how many pairs of whole numbers from 1 to n add up exactly to the target. Count each pair once, so 1+3 and 3+1 are the same pair.
int countPairs(int n, int target)
Examples
There are also 4 hidden tests you can't see. Solve the problem, not the examples.