✅Clean & Easy Code💯 || ⚡Brute force
\n# Complexity\n\n- Time complexity:\nO(m * n)\n\n- Space complexity:\nO(n)\n\n\n# Code\n# Please Upvote if it helps\uD83E\uDD17\n\nclass Solution {\npublic:\n 
\n# Complexity\n```\n- Time complexity:\nO(m * n)\n\n- Space complexity:\nO(n)\n```\n\n# Code\n# Please Upvote if it helps\uD83E\uDD17\n```\nclass Solution {\npublic:\n    bool areSimilar(vector<vector<int>>& mat, int k) {\n        int m = mat.size(), n = mat[0].size();\n        for(int i = 0 ; i < m ; i++){\n            vector<int> vec;\n            if(i & 1){\n                int x = (n - (k % n)) % n;\n                for(int j = x ; j < n ; j++)\n                    vec.push_back(mat[i][j]);\n                for(int j = 0 ; j < x ; j++)\n                    vec.push_back(mat[i][j]);\n            }\n            else{\n                int x = k % n;\n                for(int j = x ; j < n ; j++)\n                    vec.push_back(mat[i][j]);\n                for(int j = 0 ; j < x ; j++)\n                    vec.push_back(mat[i][j]);\n            }\n            if(vec != mat[i])\n                return false;\n        }\n        return true;\n    }\n};\n```
['C++']