Tip 1 : When solving the problems don't stick to the problems for too long. If you are stuck on a problem for more than half an hour. It's time to check the hint or check the solution and see what is missing and then start writing the code again.
Tip 2 : Apart from DSA also, work on your project too, Since DSA just 1-2 levels after then they will start asking questions on project.
Tip 1 : Short and crisp, of 1-page length.
Tip 2 : Your resume shouldn't lie about yourself. Because interviewer will definitely point you out if you lie something.



First I solved the question using brute force and then optimized the solution



Input: Consider the binary tree A as shown in the figure:

Output: [10, 5, 3, 7, 18, 25, 20]
Explanation: As shown in the figure
The nodes on the left boundary are [10, 5, 3]
The nodes on the right boundary are [10, 20, 25]
The leaf nodes are [3, 7, 18, 25].
Please note that nodes 3 and 25 appear in two places but are considered once.


Input: [1,2,3,4,5]
Output: [5,4,3,2,1]


Here's your problem of the day
Solving this problem will increase your chance to get selected in this company
What is recursion?