← All problemsSign in

BINARY STRING

You will be given a string of only 0 or 1. You will be given two operations to perform that are: 1. Change: Every 0 becomes 1 and every 1 becomes 0. For example, "011" becomes "100". 2. Rotate: The string is reversed. For example, "100" becomes "001". Now you are given a equation: SN = SN-1 + "0" + change(rotate(SN-1)) I,e. S0 = "", S1 = "0", S2 = "001", S3 = "0010011" ….. so on Now, you nee

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