Just enter a string of digits and the code will work out the longest string it can. The order of digits cannot be changed and the result should consist of non-descending digits (adjacent duplicates are OK). So if the input was 12454436 the longest string would be 124446 by omitting the 5 and 3. The output may not be the only valid output of that length, there just won't be anything longer.
I was just pondering this one night and thought it was a good project to do using recursion.