AlgoDaily Solution
1Locked, only available for premium members.
Community Solutions
Community solutions are only available for premium users.
Access all course materials today
The rest of this tutorial's contents are only available for premium members. Please explore your options at the link below.
xxxxxxxxxx
29
var assert = require('assert');
function remove_adjacent_duplicates(s) {
// fill in the solution
return s
}
try {
assert.equal(remove_adjacent_duplicates('abbaca'), 'ca');
console.log('PASSED: ' + "`remove_adjacent_duplicates('abbaca')` should return `'ca'`");
} catch (err) {
console.log(err);
}
try {
assert.equal(remove_adjacent_duplicates('azxxzy'), 'ay');
console.log('PASSED: ' + "`remove_adjacent_duplicates('azxxzy')` should return `'ay'`");
} catch (err) {
console.log(err);
}
try {
assert.equal(remove_adjacent_duplicates('aaaa'), '');
console.log('PASSED: ' + "`remove_adjacent_duplicates('aaaa')` should return `''`");
} catch (err) {
console.log(err);
OUTPUT
Results will appear here.