Skip to content

Instantly share code, notes, and snippets.

View NoeMastrorillo's full-sized avatar

Noé NoeMastrorillo

  • France
View GitHub Profile
import sys
from functools import cmp_to_key, partial
input = open(sys.argv[1], 'r').read().strip()
split = input.split('\n\n')
rules = set(tuple(map(int, x.split('|'))) for x in split[0].split())
updates = [list(map(int, x.split(','))) for x in split[1].split()]
def is_correct(update):