Anonymous user
Largest int from concatenated ints: Difference between revisions
→Python: Compare repeated string method: too complicated
(→Python: Compare repeated string method: Fix using LCM) |
(→Python: Compare repeated string method: too complicated) |
||
Line 263:
===Python: Compare repeated string method===
<lang python>def
key=lambda i: i*(maxlen * 2 // len(i))))▼
▲ maxlen = lcm(len(n) for n in y)
▲ key=lambda i: i*(maxlen // len(i))))
for numbers in [(212, 21221), (1, 34, 3, 98, 9, 76, 45, 4), (54, 546, 548, 60)]:
|