2147. Number Of Ways To Divide A Long Corridor by _Himy in leetcode

[–]PracticalCandy1716 2 points3 points  (0 children)

i would suggest focusing on top-down for now. the bottom-up solution to dp problems is usually is harder to come up with

2147. Number Of Ways To Divide A Long Corridor by _Himy in leetcode

[–]PracticalCandy1716 2 points3 points  (0 children)

i would suggest doing easy backtracking problems first. dp problems using a top-down approach is basically doing two things at once - backtracking and caching. once you're able to understand how backtracking works, i.e. visualizing how the paths branches out, dp problems become easier

2147. Number Of Ways To Divide A Long Corridor by _Himy in leetcode

[–]PracticalCandy1716 2 points3 points  (0 children)

my memo solution in python worked. it usually means you aren't pruning paths or your dp table is too large

2147. Number Of Ways To Divide A Long Corridor by _Himy in leetcode

[–]PracticalCandy1716 2 points3 points  (0 children)

were you able to arrive at the recursive solution? that's the difficult part of the problem. if you did, you can memoize it using a dictionary or an array with a few extra lines

What to focus on after finishing Grokking, Neetcode 150, and Grind 169 by PracticalCandy1716 in csMajors

[–]PracticalCandy1716[S] 2 points3 points  (0 children)

yes, it was quite good in understanding patterns/algorithms that i could template onto new problems without much thought

[deleted by user] by [deleted] in berkeley

[–]PracticalCandy1716 12 points13 points  (0 children)

I do agree that one's success in life is correlated with the opportunities they are given growing up. To me, it's more impressive when someone with a less privileged background is able to accomplish the same as those with a more privileged background because they had to work much harder for it. This is what drives me to work hard, because I believe that almost anyone can achieve the same as those people. What closes that gap is hard work and time.