Run #380ea5f5

completed

Score

100% (4/4)

Runtime

7μs

vs Previous

No change vs parent

Tied for best

Same as parent

Solution Lineage

Current100%Same as parent
22f02144100%Same as parent
97e89d33100%Same as parent
7aa61938100%Same as parent
bf3cc7cb100%Same as parent
1b0022fa100%Same as parent
a0476361100%Same as parent
63d9b382100%Same as parent
ade5d889100%Same as parent
67a62c16100%Same as parent
a8d34455100%Same as parent
66bab92d100%Same as parent
f7e21609100%Same as parent
037f37f8100%Same as parent
a6d896e8100%Same as parent
fc7ff349100%Same as parent
24759bcd100%Same as parent
1cf986ba100%Same as parent
0d24334d100%Same as parent
c804fcd2100%Same as parent
d0345072100%Same as parent
3a42fee5100%Same as parent
6da7503c100%Same as parent
a7c4355f100%Same as parent
6160708a100%Same as parent
a7a1adf7100%Same as parent
c262f05a100%Same as parent
f487bb71100%Same as parent
98562a4d100%Same as parent
77eb4eed100%Same as parent
b98ae242100%Same as parent
38172ecc100%Same as parent
e69a69b3100%Same as parent
0faf3ad8100%Same as parent
6fcaaa43100%Same as parent
ff05f018100%Same as parent
b1c7402a100%Same as parent
c771a435100%Same as parent
a26ef9a4100%Same as parent
2402e846100%Same as parent
fd4d992d100%Improved from parent
43aa7f6425%Regression from parent
8526c232100%Same as parent
bbb94a82100%Same as parent
1aeefd0e100%Same as parent
7b1e508d100%Same as parent
3933d6fd100%Same as parent
ab373fe2100%Same as parent
72e0a3dd100%Same as parent
ef8ec475100%Same as parent
7774af03100%Same as parent
1906c4f0100%Same as parent
a881520b100%Same as parent
ff533f20100%Improved from parent
c07852e925%Regression from parent
6c4e319f100%Same as parent
0139cffd100%Same as parent
5fd7278e100%Same as parent
2fac06cd100%First in chain

Code

from itertools import islice

def solve(input):
    it = iter(input)
    first = next(it)
    return [first] + [b - a for a, b in zip(input, islice(input, 1, None))] if input else []

Compare with Champion

Score Difference

Tied

Runtime Advantage

5μs slower

Code Size

6 vs 9 lines

#Your Solution#Champion
1from itertools import islice1def solve(input):
22 if not input:
3def solve(input):3 return []
4 it = iter(input)4 result = [input[0]]
5 first = next(it)5 previous = input[0]
6 return [first] + [b - a for a, b in zip(input, islice(input, 1, None))] if input else []6 for current in input[1:]:
77 result.append(current - previous)
88 previous = current
99 return result
Your Solution
100% (4/4)7μs
1from itertools import islice
2
3def solve(input):
4 it = iter(input)
5 first = next(it)
6 return [first] + [b - a for a, b in zip(input, islice(input, 1, None))] if input else []
Champion
100% (4/4)2μs
1def solve(input):
2 if not input:
3 return []
4 result = [input[0]]
5 previous = input[0]
6 for current in input[1:]:
7 result.append(current - previous)
8 previous = current
9 return result