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