← All problemsSign in

Hand Shake

Alan threw a party and invited all her close friend to it. Let us suppose there were 2n people in the party and all of them were sitting across a round table. The host asked them to shake hands with the condition that no two hands should cross each other i.e if 4 people are sitting then 1st person cannot shake hands with 3rd as that will cross with the hands of 2nd and 4th person. The host wants

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