Yep. Hopefully binary search or something is all you need but I'm skeptical.
See if you can spot a pattern in the calculations done on the input values. I have something which I suspect is right, but failed to collect the right information in my recursive call.
D23 done, A* too slow so I went with recursion and memoising which was shockingly fast by comparison
My basic approach using Dijkstra was ~4s, I did some mild perusal of other people's solutions and with an appropriate cost-function for A* got down to ~150ms.
See if you can spot a pattern in the calculations done on the input values. I have something which I suspect is right, but failed to collect the right information in my recursive call.
My basic approach using Dijkstra was ~4s, I did some mild perusal of other people's solutions and with an appropriate cost-function for A* got down to ~150ms.