Pergunta de entrevista da empresa Huawei Technologies

Code: eleminate 3 same char from string until no char can be removed print final string.