c++(0ms)
IntuitionApproachComplexity
Time complexity:

Space complexity:
Code
# Intuition
<!-- Describe your first thoughts on how to solve this problem. -->

# Approach
<!-- Describe your approach to solving the problem. -->

# Complexity
- Time complexity:
<!-- Add your time complexity here, e.g. $$O(n)$$ -->

- Space complexity:
<!-- Add your space complexity here, e.g. $$O(n)$$ -->

# Code
```cpp []
class Solution {
public:
  bool areSimilar(vector<vector<int>>& mat, int k) {
    k %= mat[0].size();
    if(k){
      for(int i = 0; i < mat.size(); i += 2)
        for(int j = 0, x = k; j != mat[0].size(); ++j, x = (x+1)%mat[0].size())
          if(mat[i][j] != mat[i][x]) return false;

      for(int i = 1; i < mat.size(); i += 2)
        for(int j = 0, x = mat[0].size() - k; j != mat[0].size(); ++j, x = (x+1)%mat[0].size())
          if(mat[i][j] != mat[i][x]) return false;
    }
          
    return true;
  }
};
```
['C++']