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



If the given input string is "Welcome to Coding Ninjas", then you should return "Ninjas Coding to Welcome" as the reversed string has only a single space between two words and there is no leading or trailing space.
String[] strArray = s.split(" ");
String ans = "";
for(int i = strArray.length - 1; i >= 0 ; i--){
if(strArray[i].trim() == ""){
continue;
}
ans = ans + " " + strArray[i];
}
return ans.substring(1).trim();



Input: 'arr' = [1, 2, 7, -4, 3, 2, -10, 9, 1]
Output: 11
Explanation: The subarray yielding the maximum sum is [1, 2, 7, -4, 3, 2].
Implement a last-in-first-out (LIFO) stack using only two queues. The implemented stack should support all the functions of a normal stack (push, top, pop, and empty).
Implement the MyStack class:
void push(int x) Pushes element x to the top of the stack.
int pop() Removes the element on the top of the stack and returns it.
int top() Returns the element on the top of the stack.
boolean empty() Returns true if the stack is empty, false otherwise.
private Queue queue = new LinkedList<>();
public void push(int x) {
queue.add(x);
for(int i = 1;i queue.add(queue.remove());
}
}
public int pop() {
return queue.remove();
}
public int top() {
return queue.peek();
}
public boolean empty() {
return queue.isEmpty();
}

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