compress and regenerate

This commit is contained in:
2026-02-02 13:43:27 +03:00
parent 2ed1fc9f80
commit 2a71754c6f
3 changed files with 150 additions and 35 deletions

View File

@@ -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
}