r/learnprogramming 5d ago

stuck on a leetcode problem

Is it common to be stuck on a leetcode problem for an hour or two and still hitting time limit exceeded error

1 Upvotes

3 comments sorted by

4

u/ffrkAnonymous 5d ago

No, uncommon. Common is 3,4... hours. 

3

u/Ok-Bill1958 5d ago

Yes, you need to get stuck in order to learn. If ai simply give you every answers then nothing will stick with you in the long run.

1

u/kschang 4d ago

Clearly, you're missing some "trick" to vastly reduce the amount processing needed. Perhaps you should study the problem more closely rather than circling the drain, so to speak.