My Easy Understandable C++ Solution
k is the number of char needs dropping, 'keep' is the number of char that should keep. \nWe need to remove the beginning zeroes, and finally check if the result
k is the number of char needs dropping, 'keep' is the number of char that should keep. \nWe need to remove the beginning zeroes, and finally check if the result is empty of not.\n\n```\nclass Solution {\npublic:\n    string removeKdigits(string num, int k) {\n        string res = "";\n        int n = num.size(), keep = n - k;\n        for (char c : num) {\n            while (k && res.size() && res.back() > c) {\n                res.pop_back();\n                --k;\n            }\n            res.push_back(c);\n        }\n        res.resize(keep);\n        while (!res.empty() && res[0] == '0') res.erase(res.begin());\n        return res.empty() ? "0" : res;\n    }\n};\n```
[]