Tip 1 :Prepare fundamental theory well
Tip 2 : Prepare Easy and medium level questions
Tip 3 : Go through you resume well
Tip 1:Make your resume relevant
Tip 2:Mention projects and experience


1. The grid has 0-based indexing.
2. A rotten orange can affect the adjacent oranges 4 directionally i.e. Up, Down, Left, Right.
The idea is to use Breadth First Search. The condition of oranges getting rotten is when they come in contact with other rotten oranges. This is similar to a breadth-first search where the graph is divided into layers or circles and the search is done from lower or closer layers to deeper or higher layers.



str = "ababc"
The longest palindromic substring of "ababc" is "aba", since "aba" is a palindrome and it is the longest substring of length 3 which is a palindrome.
There is another palindromic substring of length 3 is "bab". Since starting index of "aba" is less than "bab", so "aba" is the answer.
class Solution {
public String longestPalindrome(String s) {
int start = 0;
int end = 0;
for (int i = 0; i < s.length(); i++) {
int l1 = exp(s, i, i);
int l2 = exp(s, i, i+1);
int l = Math.max(l1, l2);
if(l>(end-start)){
start = i - (l-1)/2;
end = i + (l)/2;
}
}
return s.substring(start, end+1);
}
public static int exp(String s, int left, int right){
if(s==null || left>right) return 0;
while (left>=0 && right left--;
right++;
}
return (right-left)-1;
}
}
Implement Split-wise Low level design

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