Video Walkthrough | Python | Time: O(nm) | Space: O(1)
Click Here For Video Walkthrough\n\nclass Solution:\n    def areSimilar(self, mat: List[List[int]], k: int) -> bool:\n        for r in range(len(mat)):\n       
[Click Here For Video Walkthrough](https://youtu.be/sCnvsZCboI4)\n```\nclass Solution:\n    def areSimilar(self, mat: List[List[int]], k: int) -> bool:\n        for r in range(len(mat)):\n            for c in range(len(mat[0])):\n                if r % 2 == 0 and mat[r][(c-k) % len(mat[0])] != mat[r][c]: return False\n                if r % 2 == 1 and mat[r][(c+k) % len(mat[0])] != mat[r][c]: return False\n        return True\n```
[]