So I tried looking for this in the search but the closest I could come is a similar answer in several different languages, I would like to use Javascript to do it.
T
let str='aabcbd' let ans='' for (let i=0;i