Tip 1 :Practice atleast 250 questions of leetcode
Tip 2 : Do atleast 2 major projects
Tip 1:Have some projects on resume.
Tip 2:Do not put false things on resume.



You can use extra space of the order of not more than O(log n).
A binary search tree (BST) is a binary tree data structure which has the following properties.
• The left subtree of a node contains only nodes with data less than the node’s data.
• The right subtree of a node contains only nodes with data greater than the node’s data.
• Both the left and right subtrees must also be binary search trees.
1. All the elements of the Binary Search Tree are unique.
2. You can’t use the same node value/element of BST twice.




For the above binary tree,
Max value at level 0 = 6.
Max value at level 1 = max(9 , 3) = 9
Max value at level 2 = max (4, 8, 2) = 8
Tip 1:The idea is to recursively traverse tree in a pre-order fashion.



1. The root node is not considered as the node with no sibling.
2. If there are no such nodes, return -1.

Here node 4 and 7 do not have any siblings.

Here's your problem of the day
Solving this problem will increase your chance to get selected in this company
How do you remove whitespace from the start of a string?