Find count of greater numbers with duplicates

Given a number n, find number of numbers that are greater than n using the same set of digits as n. n might have duplicate digits.

Sample Input :
122
Sample Output :
2

Login to submit your solution

Fb dab53a1a64929320dc7425896aa73fd9e5512b6ab52e414ff5f3ebb5cecc73eb

Share Problem