This is a thread to discuss Day7

REMEMBER!
It is VERY important NOT to write any public spoilers
ALWAYS keep spoiler stuff hidden inside one of these

Summary

This text will be hidden

which you can obtain by clicking on the gear icon

The first iteration, quick&dirty, no optimisation at all, 'brute force'

Part1, 2 s

Part2, 17 s

Project

Part 1 done - 4.2 secs
Part 2 - 86 secs
Project

project

part 1 : 20 sec
part 2 : a very bad time ! even if I use HOF

part 2

@dardoro :i need some explications (if you have time): can you describe your algo plz.

questions inside Dardoro...
1. why 0 in front
2. what's this
3)and at the last line : numbers from 0 to max shoud be min to max ? (what if you have a neg pos? or if position are between 100000-110000?) it will be much faster with min (i think!)
Brief responses

1. why 0 in front
2. what's this
3)and at the last line : numbers from 0 to max shoud be min to max ? (what if you have a neg pos? or if position are between 100000-110000?) it will be much faster with min (i think!)

ad.1. It's initial value of the accumulator for combine. For the first iteration of combine, two first elements are used at once but EVERY element of the list must be processed by the expression

ad.2.Fuel consumption for distance of 4 = 1+2+3+4 i.e. $$\displaystyle\sum_{i=1}^ni = n(n+1)/2$$