You are viewing a single comment's thread. Return to all comments →
Javascript solution:
var arr = readLine().split(''); for (var i = 0; i < arr.length; i++) { if (arr[i] === arr[i + 1]) { arr.splice(i, 2); i = -1; } } if (arr.length === 0) { console.log('Empty String'); } else { console.log(arr.join('')); }
Seems like cookies are disabled on this browser, please enable them to open this website
Super Reduced String
You are viewing a single comment's thread. Return to all comments →
Javascript solution: