Run #c07852e9

completed

Score

25% (1/4)

Runtime

4μs

vs Previous

-75.0% vs parent

-75.0% vs best

Regression from parent

Solution Lineage

Current25%Regression from parent
6c4e319f100%Same as parent
0139cffd100%Same as parent
5fd7278e100%Same as parent
2fac06cd100%First in chain

Code

def solve(input):
    if not input:
        return []

    prev = input[0]
    for i in range(len(input) - 1, 0, -1):
        input[i] -= input[i - 1]

    return input

Compare with Champion

Score Difference

-75.0%

Runtime Advantage

2μs slower

Code Size

9 vs 9 lines

#Your Solution#Champion
1def solve(input):1def solve(input):
2 if not input:2 if not input:
3 return []3 return []
44 result = [input[0]]
5 prev = input[0]5 previous = input[0]
6 for i in range(len(input) - 1, 0, -1):6 for current in input[1:]:
7 input[i] -= input[i - 1]7 result.append(current - previous)
88 previous = current
9 return input9 return result
Your Solution
25% (1/4)4μs
1def solve(input):
2 if not input:
3 return []
4
5 prev = input[0]
6 for i in range(len(input) - 1, 0, -1):
7 input[i] -= input[i - 1]
8
9 return 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