Kodewick
Start learning →
Basic←→0 / 70

Lost and found

#039BasicMapsConditions3 min

The lost-and-found office's shelf map says where each item is kept. Write FoundAt(shelf, item) to return where the item is, like "box 3", or "not found" if it isn't in the map.

Examples
FoundAt(map[string]string{"umbrella": "shelf A", "scarf": "box 3"}, "scarf")→'box 3'
FoundAt(map[string]string{"umbrella": "shelf A"}, "keys")→'not found'
The functionfunc FoundAt(shelf map[string]string, item string) string
main.go
package main

func FoundAt(shelf map[string]string, item string) string {
	// your code here: look up where item is and return it if it's there
	return "not found"
}
Ctrl + Enter runs too
Result

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