MCPcopy Create free account
hub / github.com/neetcode-gh/leetcode / reverse

Function reverse

go/0189-rotate-array.go:8–14  ·  view source on GitHub ↗
(nums []int, start, end int)

Source from the content-addressed store, hash-verified

6}
7
8func reverse(nums []int, start, end int) {
9 for start <= end {
10 nums[start], nums[end] = nums[end], nums[start]
11 start++
12 end--
13 }
14}

Callers 1

rotateFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected