2 ms·
You still have to read all the inputs at least, which is at least linear time, in the size of the input.
by bmacho 3y ago
You still have to read all the inputs at least, which is at least linear time, in the size of the input.
- QuadmasterXLII 3y agoEach sleep is log n for the heap insertion, so the overall complexity is at least n log n