mirror of
https://github.com/lWolvesl/leetcode.git
synced 2026-06-04 02:21:15 +08:00
routine
This commit is contained in:
@@ -0,0 +1,12 @@
|
|||||||
|
package main
|
||||||
|
|
||||||
|
func reverseSubmatrix(grid [][]int, x int, y int, k int) [][]int {
|
||||||
|
for i := 0; i < k/2; i++ {
|
||||||
|
for j := range k {
|
||||||
|
temp := grid[x+k-1-i][y+j]
|
||||||
|
grid[x+k-1-i][y+j] = grid[x+i][y+j]
|
||||||
|
grid[x+i][y+j] = temp
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return grid
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user