/*
Write a function same_char_collapse that takes in a string and
returns a collapsed version of the string. To collapse the string,
we repeatedly delete 2 adjacent characters that are the same until
there are no such adjacent characters. If there are multiple pairs
that can be collapsed, delete the leftmost pair. For example, we take
the following steps to collapse "zzzxaaxy": zzzxaaxy -- zxaaxy -- zxxy -- zy
*/
console.log(sameCharCollapse("zzzxaaxy")); // "zy" === because zzzxaaxy -- zxaaxy -- zxxy -- zy
console.log(sameCharCollapse("uqrssrqvtt")); // "uv" === because uqrssrqvtt -- uqrrqvtt -- uqqvtt -- uvtt -- uv
En esta página del sitio puede ver el video en línea JavaScript Coding Challenge/Interview Question: Same Char Collapse de Duración hora minuto segunda en buena calidad , que subió el usuario Daily Coding Challenges 20 marzo 2020, comparta el enlace con amigos y conocidos, en youtube este video ya ha sido visto 183 veces y le gustó 5 a los espectadores. Disfruta viendo!