I don't understand why the second example result == 26. Can you show the path?
In particular: when you say "must go over every mountaintop" -- does that mean that the path has to touch the highest point on every mountain? In that case I would think that the shortest path for the example would be 20:
Created at: 2017/03/24 21:43; Updated at: 2017/03/24 23:25
The question is resolved.