Given a integer matrix of odd dimensions (3 * 3, 5 * 5). then the task is to find the sum of the middle row & column elements.
Input : 2 5 7 3 7 2 5 6 9 Output : Sum of middle row = 12 Sum of middle column = 18 Input : 1 3 5 6 7 3 5 3 2 1 1 2 3 4 5 7 9 2 1 6 9 1 5 3 2 Output : Sum of middle row = 15 Sum of middle column = 18
Sum of middle row = 12 Sum of middle column = 18
Time Complexity: O(n)
- Product of middle row and column in an odd square matrix
- Replace the middle element of matrix with sum of surrounding elements
- Find trace of matrix formed by adding Row-major and Column-major order of same matrix
- Print an N x M matrix such that each row and column has all the vowels in it
- Minimum element of each row and each column in a matrix
- Print matrix in zig-zag fashion from the last column
- Find column with maximum sum in a Matrix
- Program to find the Sum of each Row and each Column of a Matrix
- Check if sums of i-th row and i-th column are same in matrix
- Find a Square Matrix such that sum of elements in every row and column is K
- Print matrix in snake pattern from the last column
- Given a Boolean Matrix, find k such that all elements in k'th row are 0 and k'th column are 1.
- Replace every matrix element with maximum of GCD of row or column
- Check if the given matrix is increasing row and column wise
- Find maximum element of each column in a matrix
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to firstname.lastname@example.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.
Improved By : vt_m