Simple Modular Arithmetic - O(mn)  Time and O(1) Space Complexity
\nclass Solution:\n    def areSimilar(self, mat: List[List[int]], k: int) -> bool:\n        # Modular Arithmetic\n        # Time Complexity: O(mn)\n        # Sp
```\nclass Solution:\n    def areSimilar(self, mat: List[List[int]], k: int) -> bool:\n        # Modular Arithmetic\n        # Time Complexity: O(mn)\n        # Space Complexity: O(1)\n        m, n = len(mat), len(mat[0])\n        k %= n\n        if k:\n            for i in range(m):\n                for j in range(n):\n                    if mat[i][j] != mat[i][(j+k)%n]:\n                        return False\n        return True\n```
['Python3']