Amazon interview question

2 graph problems, 1 hashmap problem