Remove third character
This commit is contained in:
parent
6905700dd6
commit
0b9593f8ca
|
@ -1,2 +1,2 @@
|
|||
u=lambda x:7==sum(map(lambda y:len(y)>4 and{'byr':lambda x:1920<=int(x)<=2002,'iyr':lambda x:2010<=int(x)<=2020,'eyr':lambda x:2020<=int(x)<=2030,'hgt':lambda x:(x[-2:]=='cm' and 150<=int(x[:-2])<=193)or(x[-2:]=='in' and 59<=int(x[:-2])<=76),'hcl':lambda x:x[0]=='#' and len(x)==7 and int(x[1:],16)>=0,'ecl':lambda x:x+'`'in'amb`blu`brn`gry`grn`hzl`oth`','pid':lambda x:len(x)==9 and int(x)>=0,'cid':lambda x:False}[y[:3]](y[4:]),x))
|
||||
u=lambda x:7==sum(map(lambda y:len(y)>4 and{'by':lambda x:1920<=int(x)<=2002,'iy':lambda x:2010<=int(x)<=2020,'ey':lambda x:2020<=int(x)<=2030,'hg':lambda x:(x[-2:]=='cm'and 150<=int(x[:-2])<=193)or(x[-2:]=='in'and 59<=int(x[:-2])<=76),'hc':lambda x:x[0]=='#'and len(x)==7 and int(x[1:],16)>=0,'ec':lambda x:x+'`'in'amb`blu`brn`gry`grn`hzl`oth`','pi':lambda x:len(x)==9 and int(x)>=0,'ci':lambda x:False}[y[:2]](y[4:]),x))
|
||||
print(sum(map(lambda x:u(x.replace('\n',' ').split(' ')),open("/dev/stdin").read().split("\n\n"))))
|
||||
|
|
Loading…
Reference in New Issue
Block a user