Tip 1 : Never leave any topic from any chapter / Subject
Tip 2 : Learn to explain your thoughts well
Tip 3 : Learn from previous experiences / interviews / problems asked.
Tip 1 : Keep it simple and readable and don't bluff
Tip 2 : Not more than 1 page



An array ‘B’ is a subarray of an array ‘A’ if ‘B’ that can be obtained by deletion of, several elements(possibly none) from the start of ‘A’ and several elements(possibly none) from the end of ‘A’.
Made a prefix sum array.
For every index i, subtracted the minimum value between (prefix[0.....i-1]) from prefix[i].



You may assume that given ‘X’ and ‘Y’ definitely exist in the given binary tree.
For the given binary tree

LCA of ‘X’ and ‘Y’ is highlighted in yellow colour.
I first used both DFS and BFS to solve the problem and also wrote the code.
Then I explained the Binary lifting approach but was not asked to code.

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?