mthree Interview Question

coding qns 2 - 3