Tip 1 - Practice variety of questions
Tip 2 - Do atleast 2 projects
Tip 1 : Do good projects
Tip 2 : resume should be one page



We cannot use the element at a given index twice.
Try to do this problem in O(N) time complexity.
used hashmap



A 'deep copy' of a linked list means we do not copy the references of the nodes of the original linked list, rather for each node in the original linked list, a new node is created.
used hashmap to store node pointers and copied the values (2 passes)



binary search



For the given array 'ARR' = [7, 12, 1, 20]
The next greater element for 7 is 12.
The next greater element for 12 is 20.
The next greater element for 1 is 20.
There is no greater element for 20 on the right side.
So, the output is [12, 20, 20, -1].
used stack



You need to modify the given tree only. You are not allowed to create a new tree.
For the given binary search tree

11 will be replaced by {15 + 29 + 35 + 40}, i.e. 119.
2 will be replaced by {7 + 11 + 15 + 29 + 35 + 40}, i.e. 137.
29 will be replaced by {35 + 40}, i.e. 75.
1 will be replaced by {2 + 7 + 11 + 15 + 29 + 35 + 40}, i.e. 139.
7 will be replaced by {11 + 15 + 29 + 35 + 40}, i.e. 130.
15 will be replaced by {15 + 29 + 35 + 40}, i.e. 104.
40 will be replaced by 0 {as there is no node with a value greater than 40}.
35 will be replaced by {40}, i.e. 40.
Traverse tree in RPL (reverse preorder) recursively and add right child values to parent
parent += right
return parent + left



2 pointers (one pointing to head and other is traversing). Place negative values in start and keep positive values as is



Total components DFS



Down: (row+1,col)
Down left diagonal: (row+1,col-1)
Down right diagonal: (row+1, col+1)
DP

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?