Exemplo n.º 1
0
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
Exemplo n.º 2
0
def load(p: Problem):
    return [re.findall(PATTERN, instr) for instr in p.data()]
Exemplo n.º 3
0
def load(p: Problem):
    return sorted(
        p.data(dtype=int) +
        [0, max(p.data(dtype=int)) + 3])  # Append charging outlet and adapter
Exemplo n.º 4
0
def load(p: Problem):
    return p.data(dtype=int)