-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathtask159.py
More file actions
25 lines (20 loc) · 1.05 KB
/
task159.py
File metadata and controls
25 lines (20 loc) · 1.05 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
# best: 103(Code Golf International) / others: 105(ox jam), 106(intgrah jimboko awu macaque sammyuri), 107(jailctf merger), 107(HIMAGINE THE FUTURE.), 109(4atj sisyphus luke Seek mukundan)
# ================================================ 103 ================================================
# def p(g,k=0,u=[[2]*99]):
# g=g*(k>0)or p(g,k:=sum(g,[]).count(2)//12)
# return[*zip(*u+sum([k*[s]for s in g if{*s}-{0,2}],[])+u)]
# def p(g,k=0,u=[[2]*99]):
# if k<1:g=p(g,k:=str(g).count("2")//12)
# return[*zip(*sum([k*[s]for s in g if{*s}-{0,2}],u)+u)]
p=lambda g,c=-1,u=[[2]*99]:g*c or[*zip(*sum([str(g).count("2")//12*[s]for s in p(g,c+1)if{*s}-{0,2}],u)+u)]
# def p(g):
# k=sum(g,[]).count(2)//12
# u=[[2]*99]
# t=[*zip(*u+sum([k*[s]for s in g if{*s}-{0,2}],[])+u)]
# t=[*zip(*u+sum([k*[s]for s in t if{*s}-{0,2}],[])+u)]
# return t
# def p(g):
# k=sum(g,[]).count(2)//12
# t=[*zip(*[s for s in g if {*s}-{0,2}])]
# t=[*zip(*[s for s in t if {*s}-{0,2}])]
# return [[2]*(k*3+2)]+sum([[[2]+sum([[v]*k for v in s],[])+[2]]*k for s in t],[])+[[2]*(k*3+2)]