Run #7774af03

completed

Score

100% (4/4)

Runtime

14μs

vs Previous

No change vs parent

Tied for best

Same as parent

Solution Lineage

Current100%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

def solve(input):
    from itertools import starmap
    return list(starmap(lambda x, y: y - x, zip([0] + input[:-1], input)))

Compare with Champion

Score Difference

Tied

Runtime Advantage

12μs slower

Code Size

3 vs 9 lines

#Your Solution#Champion
1def solve(input):1def solve(input):
2 from itertools import starmap2 if not input:
3 return list(starmap(lambda x, y: y - x, zip([0] + input[:-1], input)))3 return []
44 result = [input[0]]
55 previous = input[0]
66 for current in input[1:]:
77 result.append(current - previous)
88 previous = current
99 return result
Your Solution
100% (4/4)14μs
1def solve(input):
2 from itertools import starmap
3 return list(starmap(lambda x, y: y - x, zip([0] + input[:-1], input)))
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