Breadth First Search Algorithm Leetcode Problems On Arrays