Cisco Interview Question

solve an easy coding problem