Pregunta de entrevista de Datadog

Two hackerRank problems during the technical test.