Pregunta de entrevista de Cisco

two easy to medium leetcode problems.