Skip to content

Commit 33a3e4f

Browse files
committed
396
1 parent f580530 commit 33a3e4f

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

base_yu/task396.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,9 @@
2222
# else:
2323
# return max((len(u:=p([*zip(*g[l::-1])],c+1)),u)for l in range(3,len(g)))[1]
2424

25-
p=lambda g,c=-3:[[v and sum({*sum(g,())})-s[0]for v in s]for s in g]*(g[0]==g[-1])*all(s[0]&s[-1]for s in g)if c>0 else max((len(u:=p([*zip(*g[l::-1])],c+1)),u)for l in range(3,len(g)))[1]
25+
# p=lambda g,c=-3:[[v and sum({*sum(g,())})-s[0]for v in s]for s in g]*(g[0]==g[-1])*all(s[0]&s[-1]for s in g)if c>0 else max((len(u:=p([*zip(*g[l::-1])],c+1)),u)for l in range(3,len(g)))[1]
26+
# p=lambda g,c=-3:[[v and sum({*sum(g,())})-s[0]for v in s]for s in g]*(g[0]==g[-1])*all(a&b for a,*_,b in g)if c>0 else max((len(u:=p([*zip(*g[l::-1])],c+1)),u)for l in range(3,len(g)))[1]
27+
p=lambda g,c=-3:[[v and sum({*sum(g,())})-s[0]for v in s]for s in g]*(g[0]==g[-1])*all(a&b for a,*_,b in g)if c>0 else max(p([*zip(*g[l::-1])],c+1)for l in range(3,len(g)))
2628

2729

2830
# def p(g):

0 commit comments

Comments
 (0)