Python - Simple Brute Force
Intuition\nEven Rows:\nCheck if mat[r][c] equals mat[r][(c + k) % COLS], because it shifted right by k.\n\nOdd Rows:\nCheck if mat[r][c] equals mat[r][(c - k) %
# Intuition\nEven Rows:\nCheck if `mat[r][c] equals mat[r][(c + k) % COLS]`, because it shifted right by k.\n\nOdd Rows:\nCheck if `mat[r][c] equals mat[r][(c - k) % COLS]`, because it shifted right left by k.\n\n# Code\n```python []\nclass Solution(object):\n    def areSimilar(self, mat, k):\n        ROWS, COLS = len(mat), len(mat[0])\n\n        for r in range(ROWS):\n            # Handle Even index\n            if r % 2 == 0:\n                for c in range(COLS):\n                    if mat[r][c] != mat[r][(c+k) % COLS]:\n                        return False\n            # Handle Odd index\n            else:\n                for c in range(COLS):\n                    if mat[r][c % k] != mat[r][(c-k) % COLS]:\n                        return False\n        return True   \n```
['Python']