PocketGem
约 1 分钟· 本文阅读 次
PocketGem
题目如下,给一个科技树
a e
/ \ /
b c
\ /
d
写一个function print出需要研究的科技
example:
If c is completed,
then techpath(d) => [a, b, d]
难点有两个:
- how to check cycle?
- how to print the path in right order?
相关文章
- Amazon OA2016-01-18
- Amazon2016-01-18
- Bloomberg2016-01-18
- BrightEdge2016-01-18
已恢复到上次阅读位置