Simple python solution with 99.90% time
Intuition\n Describe your first thoughts on how to solve this problem. \nSimple logic for loop and if else statements\n# Approach\n Describe your approach to so
# Intuition\n<!-- Describe your first thoughts on how to solve this problem. -->\nSimple logic for loop and if else statements\n# Approach\n<!-- Describe your approach to solving the problem. -->\n\n# Complexity\n- Time complexity:\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\nworst = O(n^2 / k)\n- Space complexity:\n<!-- Add your space complexity here, e.g. $$O(n)$$ -->\n\n# Code\n```python3 []\nclass Solution:\n    def areSimilar(self, mat: List[List[int]], k: int) -> bool:\n        n = len(mat[0])\n        if k%n == 0:\n          return True\n\n        c = 0\n        for i in mat:\n          i = set(i)\n          if len(i) == 1:\n            continue\n          else:\n            c = 1\n            break\n        if c == 0:\n          return True\n        if k > n:\n          return False\n        if k > n//2 and k < n:\n          k = n-k\n        c = 0\n        for i in mat:\n          for j in range(0,n-k+1,k):\n            if i[j:j+k] == i[:k]:\n              continue\n            else:\n              c = 1\n              break\n        if c == 0 :\n          return True\n\n        return False\n```
['Python3']