Alexander Avery
3 weeks ago
2 changed files with 12 additions and 3 deletions
@ -0,0 +1,10 @@ |
|||
package adventoc2024 |
|||
|
|||
func reverse(s []int) { |
|||
start, end := 0, len(s)-1 |
|||
for start < end { |
|||
s[start], s[end] = s[end], s[start] |
|||
start++ |
|||
end-- |
|||
} |
|||
} |
Loading…
Reference in new issue