100% simple logic
\nclass Solution {\n    public boolean areSimilar(int[][] mat, int k) \n    {\n        int n= mat.length;\n        int c=mat[0].length;\n\n        for(int i=0; 
\nclass Solution {\n    public boolean areSimilar(int[][] mat, int k) \n    {\n        int n= mat.length;\n        int c=mat[0].length;\n\n        for(int i=0; i<n; i++)\n        {\n            if(i%2==0)\n            {\n                for(int j=0; j<c; j++)\n                {\n                    if(mat[i][j]!=mat[i][(j+k)%c])\n                    {\n                        return false;\n                    }\n                }\n            }\n\n            else\n            {\n                for(int j=c-1; j>=0; j--)\n                {\n                    if(mat[i][j]!= mat[i][(j+k)%c])\n                    {\n                        return false;\n                    }\n                }\n            }\n        }\n\n        return true;\n\n    }\n}\n```
['Java']