def DeleteDigits(self, A, k):
        lst = map(int, list(str(A)))
        i = 0
        while i+1 < len(lst) and k > 0:
            if lst[i] > lst[i+1]:
                del lst[i]
                i -= 1
                if i < 0:
                    i = 0
                k -= 1
            else:
                i += 1
        if k > 0:
            lst = lst[:len(lst)-k]

        return "".join(map(str, lst)).lstrip("0")
Test the factory's deferred on stream initialization.
dataset/ETHPy150Open algorhythms/LintCode/Delete Digits.py/Solution.DeleteDigits--crossover with--dataset/ETHPy150Open ralphm/wokkel/wokkel/test/test_client.py/DeferredClientFactoryTest.test_deferredOnInitialized