Exemple #1
0
def convert_problem_input(problem_input_raw):
    raw = tools.convert_input_simple(problem_input_raw)
    processed = []

    for line in raw:
        processed.append(tools.convert_input_simple(line.split('x')))

    return processed
def convert_problem_input(problem_input_raw):
    raw = tools.convert_input_simple(problem_input_raw)
    processed = []

    for line in raw:
        min_max_range, letter, password = line

        min_amount, max_amount = [int(num) for num in min_max_range.split('-')]
        letter = letter.replace(':', '')

        processed.append(((min_amount, max_amount), letter, password))

    return processed
def convert_problem_input(problem_input_raw):
    raw = tools.convert_input_simple(problem_input_raw)
    converted = []

    max_x, max_y = 0, 0

    for line in raw:
        original, _, new = line
        x_orig, y_orig = [int(coord) for coord in original.split(',')]
        x_new, y_new = [int(coord) for coord in new.split(',')]
        max_x = max(max_x, x_orig, x_new)
        max_y = max(max_y, y_orig, y_new)
        converted.append(((x_orig, y_orig), (x_new, y_new)))

    return converted, (max_x, max_y)
def convert_problem_input(problem_input_raw):
    return tools.convert_input_simple(problem_input_raw)
def convert_problem_input(problem_input_raw):
    raw = tools.convert_input_simple(problem_input_raw)
    processed = [int(num) for num in raw[0].split(',')]
    return processed