Tip 1 : Solved around 500+ problems on DSA
Tip 2 : Well versed with basics
Tip 1 : Use proper and clean format
Tip 2 : Highlight all the tech used in projects



Let the array 'arr' be: [1, 0, 1].
Let ‘k’ be: 1
Then the subarrays having the number of ones equal to ‘k’ will be: [1], [1,0], [0,1], [1].



We cannot use the element at a given index twice.
Try to do this problem in O(N) time complexity.
-We need to find 2 numbers a, b so that a + b = target.
-We need a HashMap datastructure to store elements in the past, let name it seen.
-The idea is that we iterate b as each element in nums, we check if we found a (where a = target - b) in the past.
-If a exists in seen then we already found 2 numbers a and b, so that a + b = target, just output their indices.
-Else add b to the seen.
Mainly DSA based round consisting of 2 questions.



An Anagram is a word or phrase formed by rearranging the letters of a different word or phrase. We can generalize this in string processing by saying that an anagram of a string is another string with the same quantity of each character in it, in any order.
{ “abc”, “ged”, “dge”, “bac” }
In the above example the array should be divided into 2 groups. The first group consists of { “abc”, “bac” } and the second group consists of { “ged”, “dge” }.
First, get a copy of "string". Let's name this copy "sortedStrs".
Second, sort all strings in "sortedStrs".
And we have a hash map unordered_map> map.
Every string in "sortedStrs" will be recorded in this hash map with its position.
In the second loop, we traverse this hash map. And find each value of which size is larger than 1. Then find the original string in "string".



specialPush(value): should push the value in the stack in O(1).
specialPop( ) : should pop the last element from the stack in O(1).
specialTop( ): should give the element at the top of the stack in O(1).
specialMax( ): should give the maximum element from all the elements that are currently present in the stack in O(1).
Four types of queries denote these operations:
Type 1 : for specialPush(value) operation.
Type 2 : for specialPop( ) operation.
Type 3 : for specialTop( ) operation.
Type 4 : for specialMax( ) operation.
make a pair class that will contains current element and max. value in the stack at the time of inserting in the stack.
now make the stack of type pair and store the elements while updating the max element also.
I was asked in depth details of my project(around 35 minutes) and then a coding quesion




Initially, we move by the RIGHT direction.
If we meet the boundary or we meet visited cell then we change to the next direction.
Directions are in order [RIGHT, DOWN, LEFT, TOP].
We iterate m*n times to add m*n cells to our anser.

Here's your problem of the day
Solving this problem will increase your chance to get selected in this company
How do you remove whitespace from the start of a string?