2 ms·
But why didn't you use the O(n) solution instead of the O(n log n) solution?
by yes_really 5y ago
But why didn't you use the O(n) solution instead of the O(n log n) solution?
- nouveaux 5y agoTo be honest, I had forgotten the O(n) solution and vaguely remembered the nlogn solution. After that experience, I have both solutions lodged in my brain.
- wombat-man 5y agoI suppose if you had to optimize for least space used sorting in place and doing it they way they suggested would be best.