Coding Games and Programming Challenges to Code Better
Send your feedback or ask for help here!
Created by @Harry.B,validated by @ManuelJ,@DeanTheMachine and @TBali.
If you have any issues, feel free to ping them.
Coding Games and Programming Challenges to Code Better
Send your feedback or ask for help here!
Created by @Harry.B,validated by @ManuelJ,@DeanTheMachine and @TBali.
If you have any issues, feel free to ping them.
It is unclear in the puzzle if the Hometree (1.0,1.0,1.0) has a size of 1000 and can be cut also, or if it must be preserved and is considered has a needed target only for bridges made from other trees.
Ok the text of the puzzle was not clear, I started with something overcomplicated.
I thought the wood to create a bridge HAS to be taken from one of the 2 island that this bridge will connect. I was a very hard constraint and would need backtrack.
But in fact this is not needed: we have here a reformulation of the Minimum Spanning Tree problem, and I used a Kruskal algorithm with Union-Find to solve it.