Leetcode Breadth First Search Algorithm Javascript Map Example