Hi
I had my last google onsite round and my selection totally depend on this round. I got below question which I solved in NlogN in 20 mins but interviewer asked to do that in less TC without sorting.
Can someone please confirm if that is possible or not? If possible please share a accepted solution:
Question:
https://leetcode.com/problems/divide-array-in-sets-of-k-consecutive-numbers/description/
where K is 5 only and size of array could be infinite (so no count sort or mapping to smaller elements). Also elements could be -INF to +INF.
I also gave a (N/5)*N (In each iteration taking 1 group) solution which is higher than NlogN so he was not satisfied with this as well.