Tip 1: Practice 5 problems daily from coding platforms.
Tip 2: Participate in coding contests.
Tip 3: Attend mock interviews and develop good communication skills.
Tip 1: Maintain at least 2 different projects and write a powerful summary statement.
Tip 2: List skills relevant to the job description and include relevant experience.



I used DFS to find the number of distinct components.



1. When N is odd consider the middle element to be part of 1st half.
2. The sum should not contain any leading zero, except the number 0 itself.
Given Linked List: 1-2-3-4-5-5-6
First half: 1-2-3-4
Second half: 5-5-6
Output Linked List: 1-7-9-0 = (1234 + 556 = 1790)
Can you add both halves without finding the length of Linked List and in O(1) space?



Input: 'a' = [7, 12, 1, 20]
Output: NGE = [12, 20, 20, -1]
Explanation: For the given array,
- The next greater element for 7 is 12.
- The next greater element for 12 is 20.
- The next greater element for 1 is 20.
- There is no greater element for 20 on the right side. So we consider NGE as -1.
Solved using stack.



You can use any string of A multiple times.
A =[“coding”, ”ninjas”, “is”, “awesome”] target = “codingninjas”
Ans = true as we use “coding” and “ninjas” to form “codingninjas”
Paraphrasing the solution in my words
Let's take an example. s="catsand" and wordDict = ["cat", "cats", "and", "sand"].
The solution starts by taking the string S( "catsand") initially finding whether a whole string is present or not. In this case it is not present in the dict.
Now breaking the string and then finding
s.substr( i) gives the substring from the ith index till the end. so string word goes as
atsand // not present
tsand // not present
sand //present then the remainder is calculated which is a cat in this case and a recursive function is called and the same thing is done with a cat which will return the cat and also store the result in the unordered map. Now comes the combine part where both the strings are combined and pushed in the result " cat sand".
and // then comes and which is present so now again wordbreak called on remainder which is cats now and this will return cats. Now both strings are combined and inserted into the result. result = {. "cat sand", "cats and"}; Now after the loop ends the result is returned and also stored in the map.

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