from typing import Dict
from typing import List


def containsShinyGoldBag(key: str, bagMap: Dict[str, List[str]]) -> int:
   """
   Recursively sees if the key (a bag) has any gold inside it. Returns 1 if so, 0 otherwise. Part 1
   """
   flag: int = 0

   # Base cases
   if key == "no other bag":
      return 0
   if key == "shiny gold bag":
      return 1

   for val in bagMap[key]:
      flag += containsShinyGoldBag(val, bagMap)
      if flag >= 1:
         break

   return 1 if flag >= 1 else 0