You and a friend each wrote a party guest list. Write MergeGuests(mine, yours): your list first, then everyone from your friend's list who isn't on it yet, in their order. Neither list repeats a name on its own, and either may be empty.
MergeGuests([]string{"Ana", "Ben"}, []string{"Ben", "Cai"})→['Ana', 'Ben', 'Cai']MergeGuests([]string{}, []string{"Dee"})→['Dee']func MergeGuests(mine, yours []string) []stringpackage main
func MergeGuests(mine, yours []string) []string {
guests := []string{}
guests = append(guests, mine...)
for _, name := range yours {
found := false
// your code here: look for name in guests; found it? set found to true
// your code here: not found? append name to guests
}
return guests
}
Run tries the examples. When they look right, Submit.