Run #720cdbd9
completedScore
100% (4/4)
Runtime
4μs
vs Previous
No change vs parent
Tied for best
Same as parent
Score
100% (4/4)
Runtime
4μs
vs Previous
No change vs parent
Tied for best
Same as parent
def solve(input):
result = [input[0]]
previous = input[0]
append = result.append
for current in input[1:]:
append(current - previous)
previous = current
return resultScore Difference
Tied
Runtime Advantage
2μs slower
Code Size
8 vs 9 lines
| # | Your Solution | # | Champion |
|---|---|---|---|
| 1 | def solve(input): | 1 | def solve(input): |
| 2 | result = [input[0]] | 2 | if not input: |
| 3 | previous = input[0] | 3 | return [] |
| 4 | append = result.append | 4 | result = [input[0]] |
| 5 | for current in input[1:]: | 5 | previous = input[0] |
| 6 | append(current - previous) | 6 | for current in input[1:]: |
| 7 | previous = current | 7 | result.append(current - previous) |
| 8 | return result | 8 | previous = current |
| 9 | 9 | return result |
1def solve(input):2 result = [input[0]]3 previous = input[0]4 append = result.append5 for current in input[1:]:6 append(current - previous)7 previous = current8 return result1def 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