Hexaware Technologies Interview Question

Arrays based medium level question