The puzzle is to generate the first few numRows rows of Pascal’s Triangle. Do you need to keep each row in separate variables (row vector)? Apparently no. The trick …
This puzzle is from Leetcode Online Judge and this may appear quite often during interviews. This puzzle asks you to find the minimal sum for a number triangle. You …
The Dynamic Programming DP is one of the most-used approach to solve problems that satisfy the overlapping sub-problems and the optimal substructures. The simplest example is to compute Fibonacci …
Remember a couple days ago, I write a solution to this puzzle using Dynamic Programming (DP)? The DP solution helps to avoid duplicate computation in the sub-problems (smaller size). …
This is one of the classic DP (Dynamic Programming) exercises that you might be asked during your interview. To submit your solutions, you can visit LeetCode Online Judge. The …