ruby_plus's profile picture. The official http://rubyplus.com Twitter account.

Ruby Plus

@ruby_plus

The official http://rubyplus.com Twitter account.

damage and cancer is very bad for the brand. This is like the cheap motels! Front desk has no clue how to deal with the situation. Horrible customer service!


DP tip: Take the recursive code and modify it such that recursive calls are replaced by dp table lookups.


To decide on the dp table dimensions, ask yourself: What are the changing parameters to the method? These parameters need to be the keys in the lookup table.


The DFS traversal of a graph creates a tree during execution. Good way to visualize the execution and reason about the code.


Recursion by nature goes deep, DFS now makes more sense. The reason depth first traversal is named depth first search is we are searching for a solution. It's not about searching for an element. Few months ago was confused by the term DFS.


One of key design decisions to solve tree problems is to know whether the problem requires top down or bottom up approach. Does the data flow from the child to parents or does it need to flow from parent to child? Counting the number of Univalue trees is an example for bottom up.


Simulating recursion programmatically uses stack that is allocated in the heap. This has much more space available than the stack used by recursion. Stack used by recursion is much smaller than programatic stack.


Dutch National Flag problem can be solved using two pointers, it needs two scans through the array whereas three pointers can partition the array in one scan. Positioning of pointers can be either scanning from left to right or pointers that start from the extremes of the array.


Check out the book cover for my upcoming book. What do you think? #99designed 99d.me/c/mtnu


How to Solve Coding Problems - A Developer's Guide to Acquiring Problem Solving Skills

ruby_plus's tweet image. How to Solve Coding Problems - A Developer's Guide to Acquiring Problem Solving Skills

Today is the 198th day of practicing coding problems on a daily basis. I am beginning to see the relationships between problems and instead of staring at the problem without any clue, beginning to see how to quickly come up with an approach to solve the problem.


youtube.com/watch?v=_qcurE… 1339. Maximum Product of Splitted Binary Tree #leetcode


That's over 250 hours of discussion.


We now over 160 #leetcode live coding session recordings. To get free access join Leetcode Live Coding Telegram group: t.me/joinchat/VOy5L…


We are live coding the problem Unique Paths III (hard problem)


Loading...

Something went wrong.


Something went wrong.