Au bureau des objets trouvés, la map shelf indique où chaque objet est rangé. Écris FoundAt(shelf, item) pour renvoyer l’endroit où se trouve l’objet, comme "box 3", ou "not found" s’il n’est pas dans la map.
FoundAt(map[string]string{"umbrella": "shelf A", "scarf": "box 3"}, "scarf")→'box 3'FoundAt(map[string]string{"umbrella": "shelf A"}, "keys")→'not found'func FoundAt(shelf map[string]string, item string) stringpackage main
func FoundAt(shelf map[string]string, item string) string {
// ton code ici: cherche où est rangé item et renvoie l'endroit s'il y est
return "not found"
}
Exécuter teste les exemples. Quand ils sont bons, appuie sur Envoyer.