Tip 1 : Practise leetcode questions as much as possible.
Tip 2 : Try to come up with Optimised solution always.
Tip 3 : Try using c++ for the online assessments.
Tip 1 : Keep it to one side
Tip 2 : Only add the things necessary for the role that you're applying for.
Tip 3 : Don't lie in the resume and add projects related to the role.
Tip 4 : Add any volunteering work that you did.
It was an online assessment. I was given 2 coding questions was supposed to complete it in 90 Minutes.


For the given ‘HAPPINESS[]’ = ‘[-1, 0, 3]’ and ‘A’ = 0 , ‘B’ = 2. Following are the ways to group people such that the overall happiness of the group is between ‘A’ and ‘B’:
[-1, 0, 3], the sum of all the happiness values of this group is 2.
[-1, 3], the sum of all the happiness values of this group is 2.
[0], the sum of all the happiness values of this group is 0.
[ ], the sum of all the happiness values of this empty group is 0.
So the number of ways is 4.



'S' = "{}()".
There is always an opening brace before a closing brace i.e. '{' before '}', '(' before ').
So the 'S' is Balanced.
This solution utilizes a stack data structure; the C++ STL stack is used instead of implementing one from scratch.
The stack is templated with the char datatype because individual characters from the string s will be pushed on top of it as we iterate through s.
ch is assigned the pointer to the string s using the std::string::data() method. This will serve as the starting point of the while-loop, which will run as long as there as a character at the pointer.
The gist of the while-loop involves first checking if the current character is one of the left parantheses ('(', '{', or '['), or one of the right parentheses (')', '}', or ']'). If it is the former, simply push it onto the top of the stack using the std::stack::push() method. If it is the latter, check the top of the stack to see if there is a corresponding left parenthesis using the std::stack::top() method. If there is a matching left parenthesis, remove the top character from the stack using the std::stack::pop() method. However, if the top character of the stack does not match the current ch character, return false. At the end of each iteration, increment the ch pointer by 1 to move it to the next character in s.
After the while-loop, if the stack is not empty, it means that there are left parentheses that were not matched with their corresponding right parenthesis. Therefore, check whether the stack is empty using the std::stack::empty() method, and return false if the stack is not empty.
If the code has not returned false at this point, we can safely conclude that the string of parentheses is valid. Therefore, return true.

Here's your problem of the day
Solving this problem will increase your chance to get selected in this company
To make an AI less repetitive in a long paragraph, you should increase: