← All problemsSign in

Different types of cakes

Chef has opened a cake shop in NIT Jalandhar :) yay!! Each customer wants to buy cakes with a different type of topping and exactly m cakes. The chef has n cakes on a particular day lined up in a straight line and m different types of toppings. You need to find a total number of ways to put the topping such that if chef takes m consecutive cakes from anywhere, it must contain all different ty

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.

voice by Sarvam AI

Sign in to chat with the tutor and save your progress.

Sign in to start