This is a code that counts the number of digits in a number recursively. What can I add to this code to count how many different digits are in a number? Or maybe there is some other way?
int numberOfDigits(int n)
{
if(n==0)
return 0;
else
return numberOfDigits(n/10)+1;
}