Tip 1 - Practice Atleast 250 Questions
Tip 2 - Do atleast 2 projects
Tip 1 : Have some projects on resume.
Tip 2: Do not put false things on resume.



Let’s say you have an array/list ‘ARR = [1,1,2,2]’.
Then a valid rearrangement can be [1,2,1,2] or [2,1,2,1] such that no two adjacent elements are equal. [2,1,1,2] is an invalid arrangement because two adjacent elements are equal.
s1- The first test case
s2- The given array already satisfies the required condition. Here for each
s23- The second test case
s4- There is no way to reorder the elements of the given array to satisfy the required condition.
The third test case
One possible reordering is [5, 2, 7, 2, 1].


1. The grid has 0-based indexing.
2. A rotten orange can affect the adjacent oranges 4 directionally i.e. Up, Down, Left, Right.
Just followed standard procedures and good design Principles.



For the given binary tree, and X = 3:

Followed standard procedures



1. The heights of the buildings are positive.
2. Santa starts from the cell (0, 0) and he has to reach the building (N - 1, M - 1).
3. Santa cannot leave the grid at any point of time.
The solution is quite simple if the height of wall is less than or equal to x, only one jump in that wall is required else we can calculate it by height of wall-(climb up-climb down) and get the jumps required.



The idea is to use a bottom-up dynamic programming approach instead of a memoization approach. In this, we also have two choices whether to select or not. If we select then we take the occurrences of that number and the value stored at dp[i-2] as dp[i-1] will be deleted and not be taken to count. If we do not select the number then we take dp[i-1] which have been already calculated.
How will you use a linked list to simulate 3 TCP/IP packets?



Input: arr[] = {1,1,1,2,2,2}
Output: {1,2,1,2,1,2}
Note: {2,1,2,1,2,1} is also valid because there are no two adjacent elements which are the same.
Greedy with Priority Queue

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