For this Question: Given a string s, recursively remove adjacent duplicate characters from the string s. The output string should not have any adjacent duplicates. For better understanding see sample.

Note:- Solve this problem while going through left to right.<b>User Task:</b>
Since this will be a functional problem, you don't have to take input. You just have to complete the function <b>remove()</b> that takes the string as parameter.

Constraints:
1<=T<=100
1<=Length of string<=50Return the modified string.
Sample Input:-
3
geeksforgeek
acaaabbbacdddd
abcddcba

Sample Output:-
gksforgk
acac


Explanation:-

for second test case:-
acaaabbbacdddd -> acbbbacdddd -> acacdddd -> acac 

for test case 3:-
abcddcba -> abccba -> abba -> aa -> (empty string), I have written this Solution Code:  static String remove(String s)
	{
Stack<Character> st = new Stack<Character>();
Character prev = 'A';
for(int i=0;i<s.length();i++){
    if(st.empty()==true){
        if(prev!=s.charAt(i)){
        st.push(s.charAt(i));
            prev=s.charAt(i);
        }}
    else{
         if(st.peek()==s.charAt(i)){
            prev=st.peek();
            st.pop();
        }
        if(prev==s.charAt(i)){continue;}
       
        else{
            st.push(s.charAt(i));
            prev=st.peek();
        }
    }
    
}
String ans="";
while(st.empty()==false){
    ans+=st.pop();
}
String res="";
for(int i=ans.length()-1;i>=0;i--){
    res+=ans.charAt(i);
}
return res;

}, In this Programming Language: Java, Now tell me if this Code is compilable or not?