Kodewick
Start learning →
Starter←→0 / 70

Pack the water

#025StarterSlices2 min

Before the hike, the packing list is in items. Write PackBag(items) to add "water" at the end and return the list. An empty list gets water too.

Examples
PackBag([]string{"map", "hat"})→['map', 'hat', 'water']
PackBag([]string{})→['water']
The functionfunc PackBag(items []string) []string
main.go
package main

func PackBag(items []string) []string {
	// your code here: append "water" to the end of items
	return items
}
Ctrl + Enter runs too
Result

Run tries the examples. When they look right, Submit.