[Java] ✅ 1ms ✅ beats 100% ✅ CLEAN CODE ✅ CLEAR EXPLANATIONS
Approach\n1. For each row[] of mat[][], you need to determine if row[i] == row[target].\n2. The trick for even and odd is that they are similar: they both need 
# Approach\n1. For each row[] of mat[][], you need to determine if row[i] == row[target].\n2. The trick for even and odd is that they are similar: they both need same condition\n    - EG: i = 5, k = 3.\n    - right shift: row[5] == row[8]\n    - left shift: row[5] == row[2] => however, row[8] must be == row[5(8-3)].\n3. Traverse each row and calculate the equality between each column and shift.\n\n# Complexity\n- Time complexity:$$O(n * m)$$\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\n\n- Space complexity:$$O(1)$$\n<!-- Add your space complexity here, e.g. $$O(n)$$ -->\n\n# Code\n```\nclass Solution {\n    public boolean areSimilar(int[][] mat, int k) {\n        boolean similar = true;\n        int target;\n        for (int i = 0; i < mat.length && similar; i++) {\n            for (int j = 0; j < mat[0].length && similar; j++) {\n                target = (j + k) % mat[i].length; \n                similar = mat[i][j] == mat[i][target];\n            }\n        }\n        return similar;\n    }\n}\n```
['Java']