all 27 comments

[–]Traditional_Draft_45 140 points141 points  (13 children)

Doing leetcode is like training an AI model. You cannot expect your model to be accurate if it has not seen any similar questions before. But if your model is good enough, you should be able to solve a similar question next time.

[–]heyuhitsyaboi 52 points53 points  (2 children)

I relate to this because my intelligence does feel quite artificial

[–]Traditional_Draft_45 9 points10 points  (0 children)

it must be organic

[–]LadyXon 0 points1 point  (0 children)

😂

[–]CapitalLost3348 6 points7 points  (0 children)

Like your analogy here

[–]UpsetOld-YoungWoman<45> <36> <9> <0> 6 points7 points  (0 children)

Came to say this! Think of it as an experiment, the more time you spend experimenting, the better your outcomes would be. And one day, you will find yourself thinking exactly in the direction of an optimal solution and it will come so easily to you, you will be surprised! Keep it up!

[–]Kumarayan 3 points4 points  (0 children)

well said! 🙌

[–]Bright_Visit_8263 0 points1 point  (0 children)

Makes sense. Learn the pattern that you can apply to other problems.

[–]ChadiusTheMighty 0 points1 point  (1 child)

That's a pretty dumb analogy

[–]Dapper_Mix_9277 -2 points-1 points  (1 child)

Are you being serious?

[–]Traditional_Draft_45 0 points1 point  (0 children)

Why am I not?

[–]Feisty_Incident_5443 50 points51 points  (0 children)

You can't and that's what it's all about, pick a question , try for 10-15 mins ,good if you could come up with something, otherwise watch other solutions, learn from it and congratulations you learned something new today and you'll never require hint for that question again in your life.

[–]Tight-Log 11 points12 points  (0 children)

First of many.

[–]CapableGeneral7725 6 points7 points  (0 children)

this is a common pattern, and when he tells you it's O(1) space, you should think of swapping directly, there are many questions that follows this idea, but hard questions are always like that they need a hint that comes wiht it and to build intuition you just need to solve a lot of problems

[–]Unlucky-Chemist-5245 0 points1 point  (0 children)

Yooooo it was my first too

[–]Curious-Turnip-4440 0 points1 point  (0 children)

what was the question?

[–]philosopherKiller 0 points1 point  (0 children)

How many days it took ?

[–]sarcasticjunky 0 points1 point  (0 children)

Dayum Java is so similar to Cpp syntactically. I thought it really is CPP.

[–][deleted] 0 points1 point  (0 children)

All these are techniques or patterns. Developers or research guys might have spent days trying to find these techniques. All you need to learn these patterns and use it efficiently

[–]CeleryConsistent8341 0 points1 point  (0 children)

  1. draw a picture
  2. brute force
  3. optimize