/**
* @param {string} s
* @return {string}
*/
var removeDuplicates = function(s) {
let stack=[];
for(i of s){
let prev=stack.pop();
if(prev!=i){
stack.push(prev);
stack.push(i);
}
}
return stack.join('');
};