Tip 1 : Have good projects on your resume to discuss.
Tip 2 : Single page resume.
Tip 3 : Basics should be cleared.
Tip 1: Keep your resume to a single page.
Tip 2: Don’t use too many fonts; keep it simple.



A substring is a contiguous segment of a string.
1. Calculated LPS using DP (length1)
2. Length of shortest palindromic substring = 1 (length2)
3. Returned length1 - length2



Consider below matrix of characters,
[ 'D', 'E', 'X', 'X', 'X' ]
[ 'X', 'O', 'E', 'X', 'E' ]
[ 'D', 'D', 'C', 'O', 'D' ]
[ 'E', 'X', 'E', 'D', 'X' ]
[ 'C', 'X', 'X', 'E', 'X' ]
If the given string is "CODE", below are all its occurrences in the matrix:
'C'(2, 2) 'O'(1, 1) 'D'(0, 0) 'E'(0, 1)
'C'(2, 2) 'O'(1, 1) 'D'(2, 0) 'E'(3, 0)
'C'(2, 2) 'O'(1, 1) 'D'(2, 1) 'E'(1, 2)
'C'(2, 2) 'O'(1, 1) 'D'(2, 1) 'E'(3, 0)
'C'(2, 2) 'O'(1, 1) 'D'(2, 1) 'E'(3, 2)
'C'(2, 2) 'O'(2, 3) 'D'(2, 4) 'E'(1, 4)
'C'(2, 2) 'O'(2, 3) 'D'(3, 3) 'E'(3, 2)
'C'(2, 2) 'O'(2, 3) 'D'(3, 3) 'E'(4, 3)
Linear search solution was not working there as they are expecting less than O(n) complexity, so I solved this using binary search by finding the first and the last occurrence of element and subtracting them which will give the required answer.



In this question as constraints were high so simple brute force was not working so used Deque data structure to solve this question.



The largest possible answer is N+1 (if all elements from 1-N are present), so make an array called pos, of size n+1 where n is the size of given array. Initialize it with all values = - 1
-Traverse the input array and every time you encounter a number in the range 1-n update its location in the pos array.
- now traverse the pos array and find the first position with -1 as its value. The index of that position is the first missing positive number.

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