The observation is that the smallest number among the first `k + 1`

characters has to be included in the solution. You can basically leverage this idea repeatedly. Every time when you find a smallest number among the next `k+1`

characters, you can discard all the numbers on the left of that character.

```
def removeKdigits(self, num, k):
def helper(index, k, prefix):
#print index, k, prefix
if k is 0:
return prefix + num[index:]
if len(num) - index == k:
return prefix
mini = index
for i in xrange(index, index+k+1):
if num[i] < num[mini]:
mini = i
return helper(mini+1, k - (mini - index), prefix + num[mini])
result = helper(0, k, "").lstrip("0")
return result if result else "0"
```