aboutsummaryrefslogtreecommitdiff
path: root/challenge-115/lubos-kolouch/python/ch-2.py
blob: 292b11c5394e0a8939856116cb1bd6ae8701d72d (plain)
1
2
3
4
5
6
7
8
9
10
11
#!/usr/bin/env python
# -*- coding: utf-8 -*-


def largest_multiple(arr):
    arr = sorted([str(x) for x in arr if x % 2 == 0], key=lambda x: x * 3, reverse=True)
    return int("".join(arr))


# Test
print(largest_multiple([1, 0, 2, 6, 9, 4, 5]))  # Output: 6420