Problem Recently, I’ve solved this “Number of Islands” problem on LeetCode, the solution was accepted by the LeetCode OJ. Problem […]

Problem Here is a search implementation for my tree. It searches each node in a breadth-first manner first, but it […]

Problem https://leetcode.com/problems/n-ary-tree-level-order-traversal/ Given an n-ary tree, return the level order traversal of its nodes’ values. (ie, from left to right, […]

Problem The input graph to the bfs function is in the form of edge list representation. from queue import deque […]

Problem https://leetcode.com/problems/find-bottom-left-tree-value/ Given a binary tree, find the leftmost value in the last row of the tree. Example 1: Input: […]