Featured Post

Hello! and Greetings! Nice to see you on my blog.

 

8/13/2022

LeetCode Day 14

 I DO NOT LIKE THE EXAMPLES THAT LEETCODE HAS. THEY ARE HORRIBLE. I don't understand why they have the most basic examples. They don't help in coding. I digress... Finished trees. Sucked! But i learned a lot.

- I finished up graphs, but more importantly, I learned a lot about leetcode and what I'm doing wrong.

- I should stop rushing the code. I should start drawing everything out, thinking about the most clean way to complete the problem. I also need to start thinking about time efficiency. They ask those questions in interviews.

- Also think about the short cuts python provides. Ex. graph = {i:[] for i in range(num)}. That creates a boiler plate graph

- I have the logic down for these graph problems, but I'm missing the refinement. One trick is that instead of resetting the visited set, remove the current node after doing the work on it. It makes much more sense.

- Still having trouble thinking about the base cases huh??

- Leetcode sucks with their examples sometimes. They are not helpful at all. I get really annoyed by it. I can't correctly visualize the problem, and what I need to do. Stupid ass website. DFS, BFS can get hard to code, but just think about whats happening. And if the call returns a boolean, return a boolean along with it.



No comments:

Post a Comment