Given a number n, find and return the number of numbers that are greater than n using the same set of digits as n. Assume number n doesn't contain any duplicate digits.
e.g. if n is 123, you need to count the numbers which are formed using 1,2 and 3 which are greater than 123. Return 0 if no greater number is possible.
Sample Input :
Sample Output :
Login to submit your solution