simple C++ solution
Code\ncpp []\nclass Solution {\npublic:\n    bool areSimilar(vector<vector<int>>& m, int k) {\n        int col=m[0].size();\n        k=k%col;\n        if(k==0) 
# Code\n```cpp []\nclass Solution {\npublic:\n    bool areSimilar(vector<vector<int>>& m, int k) {\n        int col=m[0].size();\n        k=k%col;\n        if(k==0) return true;\n        \n        vector<vector<int>> temp=m;\n        for(int i=0;i<m.size();i++)\n        {\n            for(int j=0;j<m[i].size();j++)\n            {\n                if(i&1)\n                {\n                    temp[i][j]=m[i][(col+(j-k))%col];\n                }\n                else\n                {\n                    temp[i][j]=m[i][(col+(k+j))%col];\n                }\n            }\n        }\n\n        return m==temp;\n    }\n};\n```
['C++']