|
|
|
|
|
by unk1102
2023 days ago
|
|
Thanks solid advice I can related as I did follow the same after wasting lot of time on LC problems I cant solve. I have started getting good at LC. Since you landed job at FAANG, I would really appreciate if you can share tips on specific question says finding max path in a matrix it is graph problem but how can you master it so code flows in 30 minutes or less. Did you actually solve same problems multiple times? |
|
And yes, many problems I solved 3 or more times. If you go to the discussion section, you'll see a number of different popular solutions by users. Try to understand and implement a few of them to get a greater understanding of the problem. Once you feel like you know the problem well, delete all your code, see if you can re-implement it in under 10 minutes, then try again for 5. Keep putting in those reps, you'll get faster.
Think about how fast you can write out a simple for loop. You probably don't even think about it, the code just "flows" out. That's because you've done it hundreds or thousands of times, your subconscious takes over. You can get to that point with more complex things like breadth first search, depth first search, dynamic programming, path finding, etc. you just need to get the reps in. It's a lot of work, but if you put in the time (try for a couple hours a day) you will see the results. And, once you start getting better, leetcode can become addictive like a game, which makes practice much easier.