Matrix Similarity After Cyclic Shifts
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) {
        int n = mat.size();
        int m = mat[0].size();
        k = k % m;
        vector<vector<int>> modifiedMat = mat;
        for (int i = 0; i < n; i++) {
            if (i % 2 == 0) {
                rotate(modifiedMat[i].begin(), modifiedMat[i].begin() + k, modifiedMat[i].end());
            } else {
                rotate(modifiedMat[i].rbegin(), modifiedMat[i].rbegin() + k, modifiedMat[i].rend());
            }
        }
        return modifiedMat == mat;
    }
};

```
['C++']