Pergunta de entrevista da empresa ARxIUM

1 medium coding question, 2 SQL queries, and general questions about me. This was the coding question I was asked. Provide an algorithm for removing all consecutive duplicates from a string (keep one character and remove all subsequent same characters).