Cisco Interview Question

two easy to medium leetcode problems.