Forming the smallest number from the input number for eg.:
Input: 991233612
Output: 12369
What is the proper algorithm to solve this without using an array? I was asked this question at an interview and still can't figure out the correct way of doing it.