Unable to load image

r/drama Advent of Code S02E01 - Official DISCUSSION Thread

Ok you Python-using heathens. What did you think for difficulty this time around?

Post your coding atrocities below.

For those of you who missed the early signups. Feel free to join the leaderboard late (though rankings are based on time).

42
Jump in the discussion.

No email address required.

score = sum([int(''.join((lambda digits : (digits[0], digits[-1]))([char for char in line if char.isdigit()]))) for line in lines])

one line of pure python :marseygigachad:

edit apparently there are two parts :marseygigaretard:

also did part 2 in one line :marseychadretardtrump:

print(sum([int(''.join((lambda digits : (digits[0], digits[-1]))([number for number, index in sorted([item for sublist in [get_matches(line, number_pair) for number_pair in [(str(i+1), str(i+1)) for i in range(10)]+[(string, str(i+1)) for i, string in enumerate(['one', 'two', 'three', 'four', 'five', 'six', 'seven', 'eight', 'nine'])]] for item in sublist], key=lambda a : a[1])]))) for line in lines]))
Jump in the discussion.

No email address required.

Link copied to clipboard
Action successful!
Error, please refresh the page and try again.