Roblox interview question

Question involving string manipulation and removing consecutive characters