Sweets Problem
CodeChefOpen on judge ↗
Sam visits the most famous sweet shop in his city. The shop has an assortment of sweets of different variety. It contains a1 sweets of 1st kind, a2 sweets of 2nd kind, and so on, upto N. Now Sam has been restricted by his mother, to select exactly S number of sweets from the shop to eat. You have to help him find out the number of ways in which he can select S sweets. Sam may have multiple querie
HINT LADDERno hints yet
L1 Observation
L2 Technique
L3 Approach
L4 Pseudo-code
🔒
L5 Full solution
L5 unlocks only if you insist twice
solution.cppC++17
CodeSearch Tutor
Hints, not spoilers — it won’t hand over the full solution unless you insist.
Sign in to chat with the tutor and save your progress.
Sign in to start