
The first line contains a single integer N, the number of nodes in the level-order representation of the tree.
The second line contains N space-separated integers, representing the tree in level-order format. A value of -1 indicates a null node.
Print a single integer representing the number of nodes in the largest island. If there are no land blocks, the answer is 0.
The largest island might not include the root of the tree. You must check all possible subtrees. This problem has an optimal substructure and is well-suited for a recursive (DFS) post-order traversal approach.
Sorted Doubly Linked List to Balanced BST
Longest Substring with K-Repeating Characters
Expression Add Operators
Gray Code Transformation
Count of Subsequences with Given Sum