Upvote please
Intuition\n Describe your first thoughts on how to solve this problem. \n\n# Approach\n Describe your approach to solving the problem. \n\n# Complexity\n- Time 
# Intuition\n<!-- Describe your first thoughts on how to solve this problem. -->\n\n# Approach\n<!-- Describe your approach to solving the problem. -->\n\n# Complexity\n- Time complexity:\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\n\n- Space complexity:\n<!-- Add your space complexity here, e.g. $$O(n)$$ -->\n\n# Code\n```\nclass Solution:\n    def removeKdigits(self, num: str, k: int) -> str:\n        if k == len(num):\n            return "0"\n        answer = [num[0]]\n        for i in range(1, len(num)):\n            while len(answer) > 0 and num[i] < answer[-1] and k > 0:\n                k -= 1\n                answer.pop()\n            answer.append(num[i])\n        while len(answer) > 0 and answer[0] == \'0\':\n            answer.pop(0)\n        if len(answer) == 0 or len(answer) <= k:\n            return "0"\n        return \'\'.join(answer[:len(answer) - k])\n```
['Python3']