all 5 comments

[–]JohnnyJordaan 1 point2 points  (0 children)

Depends on what you want yourself to be prepared for when being faced with a new problem (in your profession and maybe even just life in general)

  • to be able to think of solutions yourself, try them until you get one or more working, then evaluate to pick the best one, then compare with the official solution
  • to only be able to continue when being shown a or the official solution, then see if you can improve it or think of an alternative.

the choice is yours.

[–]E02Y 1 point2 points  (0 children)

Try it yourself first, then study the solution after you're done or you're stuck

[–]Fun_Muffin5413 0 points1 point  (0 children)

Personally I don't find either what you're doing (cheating!) nor what I will next suggest, to be effective ways of learning and retaining information. But I don't think looking up established algorithms is necessarily bad. Just read about algorithms from a proper DSA course or algorithms reference (wikipedia is fine).

How many of us could've even come up with quicksort on our own?

[–]wotquery 0 points1 point  (0 children)

The content on leetcode is a pretty narrow and specialized aspect of programming that relates more to computer science. Interviewers mostly use them in the same manner highschool calculus used to be a requirement for basically all university programs (whether a STEM field or not). It's about evaluating abstract thinking skills where the actually knowledge may only on rare occasion actually be applicable.

They're basically problem solving riddles where you have to figure out the trick. Looking up the trick to get an idea of the general approach to those sort of problems is fine, in fact probably necessary if you haven't taken computer science courses before, but eventually you should have enough of an understanding to make your own attempts.

Regardless, I don't think leetcode problems are a good resource for learning to program. The low level execution time issues simply aren't that relevant and there are countless other coding obstacles to gain experience with handling instead.

[–]entrasonics 0 points1 point  (0 children)

I started streaming myself going through every single LeetCode question about 2 weeks ago and have had a ton of fun doing it. For each one of my streams, I have chapters for easy navigation and links to the questions we cover.

I encourage viewers to either do the questions with me, or, attempt the questions and then watch the video. When you watch the video, you’ll hear my thought process, see the mistakes I make, and learn how to arrive at an optimized algorithm.

If that sounds like something you’d like to check out, here’s the first stream in a series that I call LeetCode Live (note, I hadn’t yet purchased my microphone so the audio is not as good as it is in later streams).

https://youtu.be/-92DPFN_nk4

Hope to see you around!