C++ || Simple Solution || 100% faster runtime
\nclass Solution {\npublic:\n    string removeKdigits(string num, int k) {\n        int n=num.size();\n        if(n==k) return "0";\n        stack<char> st;\n  
```\nclass Solution {\npublic:\n    string removeKdigits(string num, int k) {\n        int n=num.size();\n        if(n==k) return "0";\n        stack<char> st;\n        st.push(num[0]);\n        for(int i=1; i<n; i++){\n            //You need to find the integer which is smaller than or equal to that value to \n\t\t\t//the left of element like 14591 for 1 which is at index 4 ---> 1(index=0) is equal to 1(index=4)\n            while(!st.empty() && k>0 && st.top() > num[i]){\n                st.pop(); k--;\n            }\n            //what if we meet with 0 when stack is empty that means there\'s no sense to add 0 at the beginning.\n            if(st.empty() && num[i]==\'0\') continue;\n            st.push(num[i]);\n        }\n        // after loop k is still greater than 0.\n        while(!st.empty() && k>0){\n            st.pop(); k--;\n        }\n        \n        if(st.empty()) return "0";\n        string res="";\n        while(!st.empty()){\n            res+=st.top();\n            st.pop();\n        }\n        reverse(res.begin(), res.end());\n        return res;\n    }\n};\n```
['Stack', 'C', 'C++']