MCPcopy Create free account
hub / github.com/VanjaRo/LeetCode / rotate

Function rotate

tasks/48.go:20–28  ·  view source on GitHub ↗
(matrix [][]int)

Source from the content-addressed store, hash-verified

18}
19
20func rotate(matrix [][]int) {
21 n := len(matrix)
22 for i := 0; i < len(matrix)/2; i++ {
23 for j := i; j < len(matrix)-i-1; j++ {
24 matrix[j][n-i-1], matrix[n-i-1][n-j-1], matrix[n-j-1][i], matrix[i][j] = matrix[i][j], matrix[j][n-i-1], matrix[n-i-1][n-j-1], matrix[n-j-1][i]
25
26 }
27 }
28}

Callers 1

mainFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected