Company: Walmart_12march
Difficulty: medium
Lis of tree Problem Description In a quaint little town, the local park is home to a very special binary tree that holds more than just greenery—it conceals a secret numerical pattern that has intrigued generations of townsfolk. Legend has it that the tree's nodes form a unique sequence, and hidden within this sequence is the longest increasing pattern waiting to be discovered. The challenge presented to you is both delightful and intricate. You are given the level-order traversal of a binary tree with N nodes. With this information, your mission unfolds in three parts: Construct the Binary Tree Using the provided level-order traversal, rebuild the binary tree. This tree, with its nodes arranged in a specific order, serves as the foundation for uncovering the hidden sequence. Preorder Traversal Once the tree is constructed, perform a preorder traversal on it. This means you will visit the root node first, then recursively traverse the left subtree, followed by the right subtree. The se