A non-increasing sub-sequence is a sequence in which each subsequent element is not greater than the previous element.
You are given a number N. Calculate the number of numbers <= N whose decimal representation forms a non-increasing sub-sequence.
Example – 531 has a non-increasing decimal representation while 591 does not have a non-increasing decimal representation because 5<9.