Leetcode Bfs Graph Problem Solving