Pergunta de entrevista da empresa Cisco

two easy to medium leetcode problems.