Category: Recursion

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 – 0/1 Knapsack: Length of the Longest Subsequence That Sums to Target (Recursion+Memoization=Top Down Dynamic Programming)

Teaching Kids Programming: Videos on Data Structures and Algorithms You are given a 0-indexed array of integers nums, and an integer target. Return the length of the longest subsequence …

Teaching Kids Programming – Number of Ways to Stay in the Same Place After Some Steps (Top Down Dynamic Programming Algorithm, Recursion with Memoization)

Teaching Kids Programming: Videos on Data Structures and Algorithms You have a pointer at index 0 in an array of size arrLen. At each step, you can move 1 …