Pregunta de entrevista de Walmart

LC easy on hackerrank, LC medium during live interview.