3 ms·
It's shorter in Python: sum(int(n) for n in input().split()) I'd argue it's an awful lot clearer, too. Edit: A more functional version is shorter still, bu
by mkl 7y ago
It's shorter in Python:
sum(int(n) for n in input().split())
I'd argue it's an awful lot clearer, too.
Edit: A more functional version is shorter still, but I think not worth the readability cost:
sum(map(int, input().split()))