You must log in or register to comment.
There’s O(1), O(n), O(nlgn), O( this code is crap ).
O(n)
? More LikeOh(No)
Just add a delay that pads it out the execute time to 10 seconds. O(1) ez.
That’s still good! I’m proud of you for working though the parts of the problem that you were capable of
Why would you want a specific time complexity? Wouldn’t it be better if it’s faster? /s
Likely they want a lower time complexity.
for example a question can be trivially solved in O(n^2). but there is no know < O(n) solution, so they ask for O(n)
Most of the time O(n^2) is optimized to O(n log n). You’ll get some sort of award if you can figure out a sorting function that runs in O(n).