回答編集履歴
1
Update
test
CHANGED
@@ -18,7 +18,7 @@
|
|
18
18
|
|
19
19
|
keys, vals, result = [*dic2.keys()], [*dic2.values()], []
|
20
20
|
|
21
|
-
while
|
21
|
+
while vals:
|
22
22
|
|
23
23
|
limit = len(list(takewhile(lambda a: a < 5, accumulate(vals)))) + 1
|
24
24
|
|
@@ -27,8 +27,6 @@
|
|
27
27
|
result.append(keys[:limit])
|
28
28
|
|
29
29
|
keys, vals = keys[limit:], vals[limit:]
|
30
|
-
|
31
|
-
if not vals: break
|
32
30
|
|
33
31
|
|
34
32
|
|