@@ -0,0 +1,11 @@
package main
// Removes the first occurence from the slice. Worst case O(n)
func RemoveFromSlice[T comparable](slice []T, item T) []T {
for i, v := range slice {
if v == item {
return append(slice[:i], slice[i+1:]...)
}
return slice
The note is not visible to the blocked user.