Clean implementstion
\nclass Solution:\n    def areSimilar(self, mat: List[List[int]], k: int) -> bool:\n        k %= len(mat[0])\n        for i in range(len(mat)):\n            cur
```\nclass Solution:\n    def areSimilar(self, mat: List[List[int]], k: int) -> bool:\n        k %= len(mat[0])\n        for i in range(len(mat)):\n            curr = mat[i][:]\n            curr[:k] = curr[:k][::-1]\n            curr[k:] = curr[k:][::-1]\n            curr[:] = curr[::-1]\n            if curr != mat[i]:\n                return False\n            k = len(mat[0]) - k\n        return True\n```
['Python']