#How leetcode makes input? or where I can find about the mechanic behind the solution?

16 messages · Page 1 of 1 (latest)

small troutBOT
#

When your question is answered use !solved to mark the question as resolved.

Remember to ask specific questions, provide necessary details, and reduce your question to its simplest form. For tips on how to ask a good question use !howto ask.

dapper creek
#

"Performance" in Leetcode is a meme, don't worry about it.

#

That "solution" looks like hijacking the internal code scaffolding.

#

It's not related to that.

#

What I said has nothing to do with stack or heap.

#

Just how the code is executed.

#

I have to repeat, this whole thing is a meme, you don't have to try and imitate this.

#

Because it isn't related to the main point you do this: to solve problems, not to get shiny numbers.

#

Leetcode doesn't measure submissions' "performance" properly, those numbers are pretty much meaningless.

#

Sure, but that's mostly because you are having an inferior solution, not because you are not doing the dirty hijacking.

#

With the upper bound of just 100 000 elements O(n.log(n)) isn't that much worse.

#

So, focus and write something that only takes O(n), your run time will decrease dramatically.

#

This is a very easy task by the way.

#

I don't do this kind of thing. I would just suggest doing real programming.

small troutBOT
#

Thank you and let us know if you have any more questions!

This thread is now set to auto-hide after an hour of inactivity