Pergunta de entrevista da empresa ViewLift

Find a duplicate in an array, there is only one duplicate item.

Resposta da entrevista

Sigiloso

13 de jun. de 2018

Sort the array and check if the item in the current index equals the item in the next index. If so, you have found your duplicate.