------
## 最终结论
```python
def removeKdigits(num: str, k: int) -> str:
    # 初始化结果栈
    result_stack = []
    
    # 遍历每个字符
    for digit in num:
        # 维护递增顺序
        while result_stack and k > 0 and result_stack[-1] > digit:
            result_stack.pop()
            k -= 1
        # 添加当前字符到栈
        result_stack.append(digit)
    
    # 处理剩余的k
    while k > 0:
        result_stack.pop()
        k -= 1
    
    # 生成结果字符串并去除前导零
    result = ''.join(result_stack).lstrip('0')
    
    return result if result else '0'
```