The times you have given is for the whole journey, instead of just between Jarnac and Cognac. It confused me for a while
Anyway I have checked the code you sent me in PM, and found that you have not made any calculation errors. Your error is instead in the formatting of the final answer. Please check that part of the code again
Oooh indeed. Not very proud of this one Thanks for your help !
For future readers, I transformed the list of trips into an object, using the starting point as the key and containing the destination and the distance. Then I take the object property named as our journey starting point. If the destination isn’t our journey destination, I take the corresponding property and so on until finding the right destination.
I dont know what I’m doing wrong. I’m always have 7/8 passed.
If I use floor() in Swift, for the last test I have :
Found :
CAR 2:25
answer :
CAR 2:27
And if I use (Ceil() + floor)/2, The last test passed but the test before not
found :
CAR 1:48
answer :
CAR 1:46
Someone else have the same issue ?
UPDATED : I use (round() + floor())/2 and I still have test errors for the two last entries. But My code passed the puzzle with 100%
It’s not a good idea to share any validators on the forum. However, if you want, you may send me your code in private message so that I’ll take a look and see what may be the issue.