Splunk Interview Question

BFS graph question and a greedy algorithm question.