Tip 1 : Keep working on coding skills
Tip 2 : Work smart
Tip 3 : Keep your work sorted.
Tip 1 : Keep it clean. Try not to write something that is unprofessional. Keeping clean means nice spacing and all basic needs.
Tip 2 : Also try to define yourself in the least few words. as precise as you can be.
It was in the evening. And there were 3 coding questions to solve.

One dish can be prepared by only one cook, however, two or more cooks can simultaneously prepare different dishes.
Let ‘N’ = 4, ‘ranks’ = [1, 2, 3, 4] and ‘M’ = 11. Then the minimum time required to cook 11 dishes will be 12 minutes. The cooks should prepare dishes in the following manner -:
Cook-0 prepare 4 dishes in 10 minutes i.e (1 dish in 1 minute, 1 more dish in next 2 minutes, 1 more dish in next 3 minutes, 1 more dish in next 4 minutes).
Cook-1 prepare 3 dishes in 12 minutes i.e (1 dish in 2 minutes, 1 more dish in 4 minutes, 1 more dish in 6 minutes).
Cook-2 prepare 2 dishes in 9 minutes i.e (1 dish in 3 minutes, 1 more dish in the next 6 minutes).
Cook-3 prepare 2 dishes in 12 minutes i.e (1 dish in 4 minutes, 1 more dish in the next 8 minutes).
If all four cooks work simultaneously then they can prepare(4 + 3 + 2 + 2 = 11) dishes in 12 minutes. And it is the minimum possible time.
I used a brute force solution. It just needed some implementation.



Consider the case ‘ninja’array is [ 1, 2, 3, 4 ], ‘enemies’array is [ 2, 1, 4, 5 ] and ‘allowedSwaps’ are = [ [ 0, 1 ], [ 2, 3 ] ] so after swapping in best manner according to ‘allowedSwaps’ our ‘ninja’ array becomes [ 2, 1, 4, 3 ]. So minimum Hamming distance is ‘1’ as now there is only one different element as compared to ‘ninja’ and ‘enemies’ array index.
1. You are allowed to do as many swap operations on the ‘ninja’ array as you want but according to the ‘allowedSwap’ array.
2. You are not required to print anything explicitly. It has already been taken care of. Just implement the function.


Suppose Ninja is currently standing at X city and want to visit Y city. Let the heights of all the cities in the path from X to Y(including X and Y) are 10 20 5 30. Now these series of heights forms and alternate series. So Ninja will visit the city Y.
Some examples of alternate series are 15 4 11 8 25, 100 120 50 70 60 but the series like 3 5 4 1, 6 3 10 12 are not alternating.
1 X Y: change the height of city X to Y.
2 X Y: Check whether the path between city X to Y is alternating or not.
It took place early like 11 am. The interviewer was quite happy. It was a nice experience.



'arr '= [1,2,3,4,5]
'k' = 1 rotated array = [2,3,4,5,1]
'k' = 2 rotated array = [3,4,5,1,2]
'k' = 3 rotated array = [4,5,1,2,3] and so on.
Different states of a process.
Tip 1 : Study OS thoroughly.
Tip 2 : Interview bit helped a lot.
Polymorphism, semaphores, Normalization and its types.
Tip 1 : Revise DBMS nicely.




Here's your problem of the day
Solving this problem will increase your chance to get selected in this company
To make an AI less repetitive in a long paragraph, you should increase: