Skip to content
This repository was archived by the owner on Jan 10, 2024. It is now read-only.

Commit 89ded4f

Browse files
committed
remove function
1 parent c6a7a2d commit 89ded4f

File tree

1 file changed

+1
-7
lines changed

1 file changed

+1
-7
lines changed

20.py

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,16 +6,10 @@
66

77
blocked = [map(int, d.split('-')) for d in data]
88

9-
def isAllowed(i):
10-
for bl, bh in blocked:
11-
if i >= bl and i <= bh:
12-
return (False, bh)
13-
return (True, i)
14-
159
result = [0, 0]
1610
i = 0
1711
while i <= 4294967295:
18-
allowed, i = isAllowed(i)
12+
allowed, i = next(((False, bh) for bl, bh in blocked if i >= bl and i <= bh), (True, i))
1913
if allowed:
2014
if result[0] == 0:
2115
result[0] = i

0 commit comments

Comments
 (0)