Back to Browse

LeetCode 808 – Soup Servings | DP with Memoization + Optimization Explained

166 views
Aug 8, 2025
27:21

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.

Download

0 formats

No download links available.

LeetCode 808 – Soup Servings | DP with Memoization + Optimization Explained | NatokHD