Given a string s of lower and upper case English letters.

A good string is a string which doesn't have two adjacent characters s[i] and s[i + 1] where:


	0 &lt;= i &lt;= s.length - 2
	s[i] is a lower-case letter and s[i + 1] is the same letter but in upper-case or vice-versa.


To make the string good, you can choose two adjacent characters that make the string bad and remove them. You can keep doing this until the string becomes good.

Return the string after making it good. The answer is guaranteed to be unique under the given constraints.

Notice that an empty string is also good.

&nbsp;
Example 1:

Input: s = "leEeetcode"
Output: "leetcode"
Explanation: In the first step, either you choose i = 1 or i = 2, both will result "leEeetcode" to be reduced to "leetcode".


Example 2:

Input: s = "abBAcC"
Output: ""
Explanation: We have many possible scenarios, and all lead to the same answer. For example:
"abBAcC" --&gt; "aAcC" --&gt; "cC" --&gt; ""
"abBAcC" --&gt; "abBA" --&gt; "aA" --&gt; ""


Example 3:

Input: s = "s"
Output: "s"


&nbsp;
Constraints:


	1 &lt;= s.length &lt;= 100
	s contains only lower and upper case English letters.


class Solution:
    def makeGood(self, s: str) -> str:
        while True:
            for i in range(len(s)-1):
                if s[i].lower() == s[i+1].lower() and (s[i].islower() and s[i+1].isupper() or s[i].isupper() and s[i+1].islower()):
                    s = s[:i]+s[i+2:]
                    break
            else:
                break
        return s
class Solution {
public String makeGood(String s) {
     char[] res = s.toCharArray();
    int i = 0;
    for( char n: s.toCharArray())
    {
        res[i] = n;
        
        if(i>0 && Math.abs((int) res[i-1]- (int) res[i])==32)
        {
            i-=2;
        }
        i++;
    }
    return new String(res, 0, i);
}
}
class Solution {
public:
    string makeGood(string s) {
        	stack<char>st;
	st.push(s[0]);
	string ans="";

	for(int i=1;i<s.size();++i){
		if(!st.empty() and (st.top()==s[i]+32 or st.top()==s[i]-32)){
			cout<<"top :"<<st.top()<<endl;
			st.pop();
		}

		else {

			st.push(s[i]);
		}
	}

	
		while(!st.empty()){
		// cout<<st.top()<<"";
		ans+=st.top();
		st.pop();

		}
			reverse(ans.begin(),ans.end());
	
		return ans;
	
	
    }
};
var makeGood = function(s) {
    const sArr = []
    for(let i = 0; i < s.length; i++) {
        sArr.push(s[i])
    }
    const popper = function() {
        let counter = 0
                for(let i = 0; i < sArr.length; i++) {
            if(sArr[i] !== sArr[i + 1]) {
                if(sArr[i].toUpperCase() === sArr[i + 1] || sArr[i].toLowerCase() === sArr[i + 1]) {
                    sArr.splice(i,2)
                    counter++
                }
            }
        }
        if(counter > 0) {
            popper()
        }
    }
    popper()
  
    return sArr.join('');
};

convert string to array to allow access to splice method. iterate over array checking for eqality between i and i +1  in the array. if equal, do nothing. if not equal convert to lower/uppercase and again check for equality. if equal splice those two from the array. counter checks if anything has been removed, if it has it iterates over the array again
Make The String Great