Ruby Plus
@ruby_plus
The official http://rubyplus.com Twitter account.
You might like
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
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.
We now over 160 #leetcode live coding session recordings. To get free access join Leetcode Live Coding Telegram group: t.me/joinchat/VOy5L…
UnBounded knapsack leetcode.com/problems/combi… Bounded Knapsack leetcode.com/problems/combi… leetcode.com/problems/subse… leetcode.com/problems/subse…
We are live coding the problem Unique Paths III (hard problem)
United States Trends
- 1. $RDAC N/A
- 2. Jamaica 156K posts
- 3. #10SET N/A
- 4. #NationalFirstRespondersDay N/A
- 5. Good Tuesday 33.3K posts
- 6. Wikipedia 80.1K posts
- 7. Grokipedia 122K posts
- 8. Dodgers 292K posts
- 9. $MSFT 50K posts
- 10. #WorldSeries 228K posts
- 11. #tuesdayvibe 2,267 posts
- 12. #JUNGKOOKXCALVINKLEIN 288K posts
- 13. Freddie Freeman 81.9K posts
- 14. $PYPL 35.3K posts
- 15. Hurricane Melissa 121K posts
- 16. Nelson 24K posts
- 17. Atlantic 30.1K posts
- 18. Jackie Robinson N/A
- 19. USS George Washington 38.8K posts
- 20. TIRTIR AMBASSADOR TAEHYUNG 70.6K posts
Something went wrong.
Something went wrong.