Tip 1 : Practice Atleast 250 Questions
Tip 2 : Ex- Do atleast 2 projects
Tip 1 : Have some projects on resume.
Tip 2 : Do not put false things on resume.
- Morning time
- Environment was good.
- No
- Interviewer was good



For N = 3 one valid array is [3,1,2,1,3,2].



1. The array may contain duplicate elements.
2. The array can also contain negative integers.
3. Every element of the subsequence must be greater than or equal to the previous element.



Input: NUM[] = {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 which are the same.



You need to count occurrences at every place of the number. You also need to include the lower and higher limits of the given range
Given K = 3, A = 1, B = 15, then 3 occurs 2 times(3, 13) in the range [1, 15], so you need to print 2.



N = 5
ARR = [ 3, -6, 7, -7, 0 ]
Out of all pairs, (-7,-6) have a difference of ‘1’, and no other pair has less difference. So ‘ANS’ is ‘1’.

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