def load(p: Problem): foods = [] for food in p.data(): ingredients = food.split(' (')[0].split() allergens = food.split(' (')[1].replace('contains ', '').rstrip(')').split(', ') foods.append((ingredients, allergens)) return foods
def load(p: Problem): return [re.findall(PATTERN, instr) for instr in p.data()]
def load(p: Problem): return sorted( p.data(dtype=int) + [0, max(p.data(dtype=int)) + 3]) # Append charging outlet and adapter
def load(p: Problem): return p.data(dtype=int)