compress and regenerate
This commit is contained in:
@@ -17,3 +17,14 @@ func Max(a, b int) int {
|
||||
}
|
||||
return b
|
||||
}
|
||||
|
||||
func PopSlice[S any](s []S, index int) []S {
|
||||
out := make([]S, 0)
|
||||
for i, e := range s {
|
||||
if i == index {
|
||||
continue
|
||||
}
|
||||
out = append(out, e)
|
||||
}
|
||||
return out
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user