c++ solution using stack
Intuition\n Describe your first thoughts on how to solve this problem. \nwe have to create a monotonic increasing stack. we will remove the bigger numbers from 
# Intuition\n<!-- Describe your first thoughts on how to solve this problem. -->\nwe have to create a monotonic increasing stack. we will remove the bigger numbers from leftmost side\n# Approach\n<!-- Describe your approach to solving the problem. -->\nstarting from left side of the string we will push the elements in the stack. if the number is smaller than top element pop the element form stack. repeat this until top element is smaller than the number or stack is empty. for each element we rmove decrement k by 1. once k is zero push all the remaining elements in stack. if k is not equal to zero (for eg in 1234 i.e in a increasing digits number) remove the top k elements from stack.\n# Complexity\n## ****- Time complexity: O(n)****\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\n\n# Code\n```\nclass Solution {\npublic:\n    string removeKdigits(string num, int k) {\n        if(num.size() == k) return "0";\n        stack<char> st;\n        for(char c: num){\n            while(!st.empty() && c < st.top() && k > 0){\n                st.pop();\n                k--;\n            }\n            if(st.empty() && c == \'0\') continue; \n            st.push(c);   \n        }\n        while(k != 0 && !st.empty()){\n            st.pop();\n            k--;\n        }\n        if(st.empty()) return "0";\n        string ans = "";\n        while(!st.empty()){\n            ans.push_back(st.top());\n            st.pop();\n        }\n        reverse(ans.begin(),ans.end());\n        return ans;\n    }\n};\n```
['Stack', 'Monotonic Stack', 'C++']