Hello Christopher, I can only tell that your solution is off by 1 compared to mine at my input file.
I use this code right here:
def isValidPuzzle2(self): attributes = vars(self) if len(attributes) == 8 or (len(attributes) == 7 and "cid" not in attributes): if not (1920 <= int(self.byr) <= 2002): return False if not (2010 <= int(self.iyr) <= 2020): return False if not (2020 <= int(self.eyr) <= 2030): return False if "cm" in self.hgt: if not 150 <= int(self.hgt[:-2]) <= 193: return False elif "in" in self.hgt: if not 59 <= int(self.hgt[0:-2]) <= 76: return False else: return False patternHairColor = re.compile("^#[a-f0-9]{6}$") if not patternHairColor.match(self.hcl): return False eyeColors = ["amb","blu","brn","gry","grn","hzl","oth"] if self.ecl not in eyeColors: return False patternPid = re.compile("^\d{9}$") if not patternPid.match(self.pid): return False return True else: return False
My console output:
PS C:\Users\christian.gubesch\Documents\DEV\AdventOfCode\Python\Day4> python.exe .\day4_devto.py Solution part 1: 241 Solution part 2: 185 PS C:\Users\christian.gubesch\Documents\DEV\AdventOfCode\Python\Day4> python.exe .\day4.py Puzzle 1: 242 Puzzle 2: 186
Maybe I have time tomorrow to find the specific case for you.
Cheers ;)
Are you sure you want to hide this comment? It will become hidden in your post, but will still be visible via the comment's permalink.
Hide child comments as well
Confirm
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Hello Christopher,
I can only tell that your solution is off by 1 compared to mine at my input file.
I use this code right here:
My console output:
Maybe I have time tomorrow to find the specific case for you.
Cheers ;)