← All problemsSign in

Darshan And His Cat

Darshan loves his cat! But his cat doesn't love him. His cat is too selfish to be homed! Once a day, while his cat was asleep, Darshan thought he could complete a task given by his boss. Darshan had a string of $N + 1$ integers (0 to $N$) written on his book, but in their binary form and without any leading zeroes. For example if $N = 4$, his book contained 011011100. ("0" + "1" + "10" + "11" + "1

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