Google Interview Question

Dynamic programming an directed graph