Snippets Collections
class Solution
    //Function to exchange first column of a matrix with its last column.
    static void exchangeColumns(int matrix[][])
       int temp = 0;
       for (int i=0; i<matrix.length; i++)
            temp = matrix[i][0];
            matrix[i][0] = matrix[i][matrix[i].length-1];
            matrix[i][matrix[i].length-1] = temp; 

Tue Feb 08 2022 08:41:01 GMT+0000 (Coordinated Universal Time)

#java #gfg #geeksforgeeks #2d #array #matrix #practice #exchangecolumns

Save snippets that work with our extensions

Available in the Chrome Web Store Get Firefox Add-on Get VS Code extension