When order matters and repetition is allowed, r selections from n options give:
r
n
Return the count.
Input
n = 10 r = 4
Output
10000
solve(...)