El hotel de mascotas guarda rooms: el número de habitación de cada mascota. Escribe IsStaying(rooms, pet) para devolver true si la mascota se aloja allí y false si no. La habitación 0 también es una habitación de verdad.
IsStaying(map[string]int{"Mochi": 3, "Bean": 5}, "Bean")→TrueIsStaying(map[string]int{"Mochi": 3}, "Rex")→Falsefunc IsStaying(rooms map[string]int, pet string) boolpackage main
func IsStaying(rooms map[string]int, pet string) bool {
// tu código aquí: busca pet en rooms; devuelve true si está
return false
}
Ejecutar prueba los ejemplos. Cuando salgan bien, Enviar.