educative.io

The recursive call after excluding the coin at the currentIndex

In the Top-down Dynamic Programming, in below codes,
// recursive call after excluding the coin at the currentIndex
int count2 = countChangeRecursive(denominations, total, currentIndex + 1);

why not write below way(like what did for count1)?
int count2 = Integer.MAX_VALUE;
int res = countChangeRecursive(denominations, total, currentIndex + 1);
if(res != Integer.MAX_VALUE){
count2 = res + 1;
}