Ola Interview Experience for SDE-2 2022
Just given the test.It was an online test. Directly come to questions. There were 2 questions.
- Ignore all negative numbers and then print the mid element of the new array of positive numbers. It’s guaranteed that there will always be at least one positive number The order should be maintained as the original array. In the case of 2 mid elements, pick the element with a lower index.
- Shorten the given input string in a specified manner. if consecutive elements, then delete them from the string and recheck again for consecutive duplicates from the * *remaining string. Repeat it till the string contains, no consecutive duplicates.
Given string input : str ="zaaabccbaddd" output : zd
All the consecutive characters will be deleted.
zaaabccbaddd -> z(aa)ab(cc)ba(dd)d -> za(bb)ad -> z(aa)d -> zd these pairs will be deleted
My Personal Notes arrow_drop_up