Showing:
Handle Score
@Ibrahim Nash 5761
@akhayrutdinov 5111
@mb1973 4989
@Quandray 4944
@saiujwal13083 4506
@sanjay05 3762
@marius_valentin_dragoi 3516
@sushant_a 3459
@verma_ji 3341
@KshamaGupta 3318
Matrix Interchange - Java
Easy Accuracy: 51.88% Submissions: 12109 Points: 2

Working with 2D arrays is quite important. Here we will do swapping of column in a 2D array. You are given a matrix M or r rows and c columns. You need to swap the first column with the last column.

Example:

Input:
3 4
1 2 3 4
4 3 2 1
6 7 8 9

Output:
4 2 3 1
1 3 2 4
9 7 8 6

Since this is a function problem, you don't need to take any input. Just complete the provided function interchange(int, int , int ) that take matrix, rows and columns as parameters.

Constraints:
1 <= r,c <= 100