Tag: Top Down

Teaching Kids Programming – Paint Fences (No 3 Consecutive Same Colours) – Top Down Dynamic Programming Algorithm (Recursion + Memoization)

Teaching Kids Programming: Videos on Data Structures and Algorithms You are painting a fence of n posts with k different colors. You must paint the posts following these rules: …

Teaching Kids Programming – Compute the Amount of Water of a Glass in a Pyramid Stacked Glasses (Top Down Dynamic Programming Algorithm – Recursion with Memoization)

Teaching Kids Programming: Videos on Data Structures and Algorithms We stack glasses in a pyramid, where the first row has 1 glass, the second row has 2 glasses, and …

Teaching Kids Programming – Minimum Operations to Reduce X to Zero (Two Pointer + Top Down Dynamic Programming Algorithm + Recursion with Memoization)

Teaching Kids Programming: Videos on Data Structures and Algorithms You are given an integer array nums and an integer x. In one operation, you can either remove the leftmost …

Teaching Kids Programming – Minimum Operations to Reduce an Integer to 0 (Greedy Recursion/Top Down Dynamic Programming Algorithm)

Teaching Kids Programming: Videos on Data Structures and Algorithms You are given a positive integer n, you can do the following operation any number of times: Add or subtract …