TATA ELXSI Interview Question

Operation based on 2D array.