question: You are given a number N. a number is called beautiful if for every digit x in the number there are x occurrences of it in the number.
determine the samllest beautiful number which is greater than N.
eg. N=1 ans: 22 is the smallest beautiful number greater than 1
N=250 ans: 333
how to solve this without travelling through every next element to determine the correct output??