Pergunta de entrevista da empresa Amazon

Remove all consecutive characters in a string. bottom -> boom-> bm (return "bm")

Respostas da entrevista

Sigiloso

31 de out. de 2017

Used a simple iterative approach that maintained a variable that stored the current character. Mistake made was that I used string manipulation, which I wouldve changed had I had more time. Smarter solution would have been to declare an auxiliary array of boolean values representing whether the characters would be present in the string. Perform one pass where you set all the boolean values and a second to actually create the final string.

Sigiloso

4 de jul. de 2018

Using stack