I realize that my 1100 solution is way overkill. My solution actually finds out a proper (reverse) order to visit the nodes. The ideal solution would simply find out how long it takes, and ignore the path needed.

Also, I could have sloved this using the heap provided (and heapified it if needed) instead of making my own tree structure.