In this video, we solve LeetCode Problem 808 – Soup Servings using top-down dynamic programming with memoization. We optimize the problem by scaling down the input using 25ml units and add an early return for large inputs (n ≥ 5000), where the result converges to 1.
🔹 What you'll learn:
How to model the problem using recursion and memoisation
Base cases to handle different soup depletion scenarios
Optimisation trick for large n values
Why does reducing the problem size (dividing by 25) help
Time and space complexity breakdown
🎯 This is a classic example of probability + DP with overlapping subproblems.