← All problemsSign in

The Magic Trick

Sircar is considered to be one of the greatest magicians of all time and you have a chance to get a lucky ticket to his show! Sircar shows you one of his most divine tricks of magical illusion. The trick is as follows: He has 2 decks of cards, deck A and deck B. Number of cards in deck A is N and number of cards in deck B is M. Deck A has cards numbered from 1 to N, while deck B has cards numbere

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