Error
|
|
---|---|
@Ibrahim Nash | 5761 |
@blackshadows | 5715 |
@akhayrutdinov | 5111 |
@mb1973 | 4989 |
@Quandray | 4944 |
@saiujwal13083 | 4506 |
@sanjay05 | 3762 |
@marius_valentin_dragoi | 3516 |
@sushant_a | 3459 |
@verma_ji | 3341 |
@KshamaGupta | 3318 |
Complete Leaderboard | |
|
|
@aroranayan999 | 1115 |
@bt8816103042 | 739 |
@thealchemist627 | 456 |
@dalwainazism125 | 453 |
@akashkale117 | 453 |
@shivanandp12345678910 | 453 |
@codeantik | 448 |
@SherlockHolmes3 | 447 |
@SHOAIBVIJAPURE | 430 |
@shalinibhataniya1097 | 408 |
@ShamaKhan1 | 392 |
Complete Leaderboard |
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
Your Task:
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
We strongly recommend solving this problem on your own before viewing its editorial. Do you still want to view the editorial?
Yes