function rotate(matrix) {
return matrix[0].map((col, i) => matrix.map((row) => row[i]))
}
function rotateAntiClockwise(matrix) {
return matrix[0].map((col, i) => matrix.map((row) => row[i]).reverse())
}
matrix[0].map((val, index) => matrix.map(row => row[index]).reverse())