O(nlgn) time is accepted for this problem?


#1

O(nlgn) time is accepted for this problem?


#2

It should not be. We were looking for O(n) solution. This just indicates that our test data is weak. Will work on correcting it.


#3

Anshuman Singh Hey, The o(nlogn) solution still works. I solved it with O(nlogn).


#4

Anshuman Singh I submitted an O(nlgn) solution and it was accepted.


#5

I assume you did a binary search. This gives O(nlogn) time complexity. But the question states less than O(n) space complexity. It is satisfied right. O(1). Why do we need to do it O(n) time complexity then ? I seem to not understand this.


#7

I’ve solved this with O(nlogn) using binary search. Please improve tests, or at least add O(n) time constraint to problem statement.