MCPcopy Create free account
hub / github.com/austingebauer/go-leetcode / reverse

Function reverse

reverse_words_in_a_string_151/solution.go:68–79  ·  view source on GitHub ↗
(a []string)

Source from the content-addressed store, hash-verified

66}
67
68func reverse(a []string) {
69 front := 0
70 back := len(a) - 1
71 for front < back {
72 hold := a[back]
73 a[back] = a[front]
74 a[front] = hold
75
76 front++
77 back--
78 }
79}

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected