9 lines
180 B
Go
9 lines
180 B
Go
package utils
|
|
|
|
func ReverseSlice(src []int) []int {
|
|
for from, to := 0, len(src)-1; from < to; from, to = from+1, to-1 {
|
|
src[from], src[to] = src[to], src[from]
|
|
}
|
|
return src
|
|
}
|