EASY C++ 100% Brute Force
Code\ncpp []\nclass Solution {\npublic:\n    void reverse(vector<int>& arr, int low, int high) {\n        while (low < high) {\n            swap(arr[low], arr[h
# Code\n```cpp []\nclass Solution {\npublic:\n    void reverse(vector<int>& arr, int low, int high) {\n        while (low < high) {\n            swap(arr[low], arr[high]);\n            low++;\n            high--;\n        }\n    }\n    void rotateArr(vector<int>& arr, int n, int direction, int k) {\n        if (direction == 1) //if 1 than rotate right\n            k = n - k;\n        reverse(arr, 0, k - 1);  \n        reverse(arr, k, n - 1);  \n        reverse(arr, 0, n - 1);  \n    }\n\n    bool areSimilar(vector<vector<int>>& mat, int k) {\n        int n = mat[0].size(), m = mat.size();\n        if (k % n == 0)\n            return true;\n        else\n            k %= n;\n        for (int i = 0; i < m; i++) {\n            vector<int> temp = mat[i];\n            rotateArr(temp, n, i & 1, k);  \n            if (temp != mat[i]) \n                return false;\n        }\n        return true;\n    }\n};\n\n```
['C++']