Run #c07852e9
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(len(input) - 1, 0, -1):
input[i] -= input[i - 1]
return inputScore Difference
-75.0%
Runtime Advantage
2μs slower
Code Size
9 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(len(input) - 1, 0, -1): | 6 | for current in input[1:]: |
| 7 | input[i] -= input[i - 1] | 7 | result.append(current - previous) |
| 8 | 8 | previous = current | |
| 9 | return input | 9 | return result |
1def solve(input):2 if not input:3 return []45 prev = input[0]6 for i in range(len(input) - 1, 0, -1):7 input[i] -= input[i - 1]89 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