#  #  # There is an edge with the cost between a node to node # Please find the min-cost from the root to leaf and return the leaf node # - [3, 5] => 8 # - [3, 7] => 10 # - [4, 6] => 10 # - [5, 2] => 7 (min-cost) # - [5, 10] => 15 # class Edge: # def __init__(self, node, cost=0): # self.cost = cost # self.node = node # class Node: # def __init__(self, edges): # self.edges = edges # def getMinCostLeafNode(root):
×
Sign in
Email
Password
Forgot password
or
By clicking below, you agree to our
terms of service
.
Sign in via Facebook
Sign in via Twitter
Sign in via GitHub
Sign in via Dropbox
Sign in with Wallet
Wallet (
)
Connect another wallet
New to HackMD?
Sign up