C++ || Using Stack || Easy Solution
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: O(n)\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\n\n- Space complexity: O(n)\n<!-- Add your space complexity here, e.g. $$O(n)$$ -->\n\n# Code\n```\nclass Solution {\npublic:\n    int minDeletion(vector<int>& nums) {\n        int n = nums.size();\n        int ans = 0;\n        stack<int> st;\n        st.push(nums[0]);\n\n        for(int i=1;i<n;i++){\n            if(st.size()%2 == 1 and st.top() == nums[i]){ // if stack size is odd means even postion of i index of nums and top of stack and nums[i] are equal then it delete the top no\n              ans++;\n                st.pop(); \n            } \n            st.push(nums[i]);\n        }\n\n        return (st.size()%2 == 1) ? ans+1: ans; // if stack size is odd then increase the ans by 1 to make array beautiful.\n        \n    }\n};\n```
['C++']