Pregunta de entrevista de Amazon

Array based coding question was asked