1st approach: greedy + bfs