Pergunta de entrevista da empresa Capital One

Minimum peak elements from an array by their repeated removal at every iteration of the array