1. Have you worked in the FMCG sector?
2. How can a rider earn 24000 monthly with 2.3 orders per hour?
3. How do you ensure a store runs efficiently?
4. What do you know about Blinkit?
5. Top View of Binary Tree Given a binary tree of integers, the task is to return the top view of the given binary tree. The top view of the binary tree is the set of nodes visible when viewed from the top. Input: The first line contains an integer 'T' which denotes the number of test cases. The first line of each test case contains elements of the tree in level-order format, with values separated by spaces. Use -1 to denote null nodes. Output: For each test case, return a list of integers representing the top view of the given tree. Example: For the given binary tree: The top view of the tree will be {10, 4, 2, 1, 3, 6}. Example Input: 1 2 3 4 -1 5 6 -1 7 -1 -1 -1 -1 -1 -1 Explanation: Level 1: The root node is 1. Level 2: Left child of 1 is 2, right child of 1 is 3. Level 3: Left child of 2 is 4, right child is null (-1), left child of 3 is 5, right is 6. Level 4: Right child of 4 is 7, all other children are null (-1). 1 2 3 4 -1 5 6 -1 7 -1 -1 -1 -1 -1 -1 Constraints: 1 <= T <= 100 0 <= N <= 1000 0 <= data <= 10^6 and data != -1 Where ‘N’ is the total number of nodes, and 'data' is the value of the binary tree node. Time limit: 1 sec Note: The input ends when all nodes at the last level are null (-1). You don't need to print the output. Implement the function to return the answer.
Browse through a variety of job opportunities tailored to your skills and preferences. Filter by location, experience, salary, and more to find your perfect fit.
We have sent an OTP to your contact. Please enter it below to verify.