Deloitte National Level Assessment (NLA) | Nearest Number Matrix Operations | Feb 5th Slot | 2D Arrays & Mathematical Rounding Algorithms | Coding Round Solutions | Replace Matrix Elements
Deloitte · Question · Posted Mar 2026
Question: Matrix Element Replacement (Nearest Divisible by 5) Problem Statement: Consider A is a square matrix with size N. Write a program to replace every element A[i][j] of the matrix with a number that is nearest to or equal to A[i][ j] divisible by 5. Read the input from STDIN and write the output to STDOUT. You should not write arbitrary strings while reading the input and while printing as these contribute to the standard output. Constraints: 1 < N ...
The full answer & interview discussion are available to premium members.
Log in Create a free account