Run #43aa7f64
completedScore
25% (1/4)
Runtime
4μs
vs Previous
-75.0% vs parent
-75.0% vs best
Regression from parent
Score
25% (1/4)
Runtime
4μs
vs Previous
-75.0% vs parent
-75.0% vs best
Regression from parent
def solve(input):
if not input:
return []
prev = input[0]
for i in range(1, len(input)):
current = input[i]
input[i] -= prev
prev = current
return inputScore Difference
-75.0%
Runtime Advantage
2μs slower
Code Size
10 vs 9 lines
| # | Your Solution | # | Champion |
|---|---|---|---|
| 1 | def solve(input): | 1 | def solve(input): |
| 2 | if not input: | 2 | if not input: |
| 3 | return [] | 3 | return [] |
| 4 | 4 | result = [input[0]] | |
| 5 | prev = input[0] | 5 | previous = input[0] |
| 6 | for i in range(1, len(input)): | 6 | for current in input[1:]: |
| 7 | current = input[i] | 7 | result.append(current - previous) |
| 8 | input[i] -= prev | 8 | previous = current |
| 9 | prev = current | 9 | return result |
| 10 | return input | 10 |
1def solve(input):2 if not input:3 return []4 5 prev = input[0]6 for i in range(1, len(input)):7 current = input[i]8 input[i] -= prev9 prev = current10 return input1def 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 = current9 return result