Money Sums (CSES) | Subset Sum DP Explained | Count All Possible Sums Using Dynamic Programming
In this video, we solve the ๐๐จ๐ง๐๐ฒ ๐๐ฎ๐ฆ๐ฌ problem from the ๐๐๐๐ ๐๐ฒ๐ง๐๐ฆ๐ข๐ ๐๐ซ๐จ๐ ๐ซ๐๐ฆ๐ฆ๐ข๐ง๐ section, which is a perfect example of the classic subset sum problem.โฃโฃ โฃโฃ Given a list of coins, we determine all the distinct positive sums that can be formed using any subset of the coins. This is a fundamental dynamic programming pattern that appears frequently in coding contests and interviews.โฃโฃ โฃโฃ ๐ก What you'll learn:โฃโฃ - How to use a boolean DP array to track achievable sumsโฃโฃ - Why reverse iteration avoids overcounting in subset sum problemsโฃโฃ - How to efficiently compute and extract all valid sumsโฃโฃ - Real-world applications of subset sum logicโฃโฃ โฃโฃ This problem is part of our full Dynamic Programming Series, featuring curated problems from ๐๐๐๐, ๐๐ญ๐๐จ๐๐๐ซ, ๐๐จ๐๐๐๐จ๐ซ๐๐๐ฌ, ๐๐๐๐ญ๐๐จ๐๐, ๐๐จ๐๐๐๐ก๐๐, and more โ moving from beginner-friendly explanations to advanced DP techniques.โฃโฃ โฃ Problem Link : https://cses.fi/problemset/task/1745โฃ โฃโฃ #MoneySums #SubsetSum #DynamicProgramming #CSES #CompetitiveProgramming
Download
0 formatsNo download links available.