
Let 'R' = 3, 'C' = 4, and 'M' be:
[[1, 2, 3, 4],
[5, 6, 7, 8],
[9, 10, 11, 12]]
The maximum value of the first row is 4.
The maximum value of the second row is 8.
The maximum value of the third row is 12.
Therefore, the answer is [4 8 12].
The first line contains two integers, 'R' and 'C', representing the number of rows and columns in the matrix 'M'.
The next 'R' lines each contain 'C' integers, representing the elements of the matrix 'M'.
Return an array containing the maximum value of each row in 'M'.
You don’t need to print anything. Just implement the given function.
1 <= 'R, C' <= 10^3
-10^5 <= 'M[i][j]' <= 10^5
Time Limit: 1 sec
Approach:
Algorithm: