← All problemsSign in

Monica Loves Arrangements

Monica gets gifts for the Christmas party, some of them are wrapped in red packing paper and some in blue. Being a perfectionist, she wants to arrange these gifts in a row such that no two adjacent gifts are the same in color. Given that there are $N$ gifts which are red in color and $M$ gifts which are blue in color. Help Monica to find out the total number of ways in which she can arrange t

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