Challenge 2 — Solution Task: Write a generic function Contains[T comparable](items []T, target T) bool that returns true if target appears anywhere in items. Test it once with a []string and once with a []int. package main import "fmt" func Contains[T comparable](items []T, target T) bool { for _, item := range items { if item == target { return true } } return false } func main() { names := []string{"Alice", "Bob", "Carl"} fmt.Println(Contains(names, "Bob")) fmt.Println(Contains(names, "Dana")) numbers := []int{10, 20, 30} fmt.Println(Contains(numbers, 20)) } Expected output: true false true Notes: - comparable is required here specifically because the function body uses == — a constraint like any would not compile, since not every type supports == (e.g. slices and maps don't). - The same Contains function works on both []string and []int with no changes — T is inferred separately for each call based on the slice's element type. - Returning early with "return true" the moment a match is found avoids checking the rest of the slice unnecessarily.