Previous thread: adventofcode.com/ >Advent of Code is a series of small programming puzzles for a variety of skill levels. They are self-contained and are just as appropriate for an expert who wants to stay sharp as they are for a beginner who is just learning to code. Each puzzle calls upon different skills and has two parts that build on a theme. You need to register with an account but you can appear as anonymous.
Private leaderboard join code (currently full):
368748-e33dcae3
People who are inactive for 5 days will be kicked, but other leaderboards can be made if desired.
Alternative leaderboard for those waiting for inactives to be kicked from the first:
def obfuscate(data,num): from random import randint, choice from string import ascii_lowercase as lo, ascii_uppercase as up ins = [a+b for a,b in list(zip(up,lo)) + list(zip(lo,up))] for _ in range(num): n = randint(0,len(data)) rep = choice(ins) data = data[:n] + rep + data[n:] return data
Noah Morales
import string
def polylen(line): while 1: oldLen = len(line) for c in string.ascii_lowercase: line = line.replace(c + c.upper(), "") line = line.replace(c.upper() + c, "") if len(line) == oldLen: return len(line)
x = open("input").read().strip() best_d = float('inf') for c in string.ascii_lowercase: d = polylen(x.replace(c, "").replace(c.upper(), "")) if d < best_d: best_d = d