HCLTech Interview Question

remove consecutive duplicate characters in a string