Given a matrix, we have to find the sum of each row and each column.
Example:
Input:
matrix:
[3, 4, 5]
[6, 3, 3]
[2, 1, 2]
[3, 4, 3]
Output:
[3, 4, 5] : SumOfRow-> 12
[6, 3, 3] : SumOfRow-> 12
[2, 1, 2] : SumOfRow-> 5
[3, 4, 3] : SumOfRow-> 10
Sum of 1 column : 14
Sum of 2 column : 12
Sum of 3 column : 13
Program to find the sum of each row and each column of a matrix in Kotlin
Output
need an explanation for this answer? contact us directly to get an explanation for this answer