---
# System prepended metadata

title: Untitled

---

![](https://i.imgur.com/LB3ufRK.png)

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):
```
    