Tip 1 : Do Leetcode Daily
Tip 2 : Focus on Projects
Tip 3 : Be consistent
Tip 1 : Be Practical in what are you writing
Tip 2 : Write things you know and be correct
DSA 3 questions



The width of each bar is the same and is equal to 1.
Input: ‘n’ = 6, ‘arr’ = [3, 0, 0, 2, 0, 4].
Output: 10
Explanation: Refer to the image for better comprehension:

You don't need to print anything. It has already been taken care of. Just implement the given function.
Take two pointers l and r. Initialize l to the starting index 0 and r to the last index N-1.
Since l is the first element, left_max would be 0, and right_max for r would be 0.
While l ≤ r, iterate the array. We have two possible conditions
Condition1 : left_max <= right max
Consider Element at index l
Since we have traversed all elements to the left of l, left_max is known
For the right max of l, We can say that the right max would always be >= current r_max here
So, min(left_max,right_max) would always equal to left_max in this case
Increment l.
Condition2 : left_max > right max
Consider Element at index r
Since we have traversed all elements to the right of r, right_max is known
For the left max of l, We can say that the left max would always be >= current l_max here
So, min(left_max,right_max) would always equal to right_max in this case
Decrement r.



In the given linked list, there is a cycle, hence we return true.

tortoise and hare algorithm



DP using memoization(Top down approach)
Design Instagram
Why HashedIn?
How do you respond to change?

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?