Pergunta de entrevista da empresa Arista Networks

1st stage: HackerRank easy to medium problem