Easy Java Code || Beats 100%
Complexity\n- Time complexity:\nO(n*n)\n- Space complexity:\nO(1)\n# Code\n\nclass Solution {\n    public boolean areSimilar(int[][] mat, int k) {\n        for(
# Complexity\n- Time complexity:\nO(n*n)\n- Space complexity:\nO(1)\n# Code\n```\nclass Solution {\n    public boolean areSimilar(int[][] mat, int k) {\n        for(int i=0; i<mat.length; i++){\n            for(int j=0; j<mat[0].length; j++){\n                if(mat[i][j] != mat[i][(j+k) % mat[0].length]){\n                    return false;\n                }\n            }\n        }\n        return true;\n    }\n}\n```
['Java']