Python simple solution only 2 lines
\n\n# Code\npython3 []\nclass Solution:\n    def areSimilar(self, mat: List[List[int]], k: int) -> bool:\n        m , n = len(mat) , len(mat[0])\n        return
\n\n# Code\n```python3 []\nclass Solution:\n    def areSimilar(self, mat: List[List[int]], k: int) -> bool:\n        m , n = len(mat) , len(mat[0])\n        return mat == ([mat[i][k%n:] + mat[i][0:k%n] if i % 2 == 0 else(mat[i][-k%n:] + mat[i][:-k%n]) for i  in range(m)])\n```
['Python3']