Pregunta de entrevista de Amazon

debug question, logic question, coding challenge given after. Short time for it all. debugging unique amount numbers etc.. needed more time to do questions, very short.