← All problemsSign in

Srikant And The Diverse String

Srikant has a string which consists of $0s$ and $1s$. He can change the characters in the string i.e if a character is $0$ he can change it to $1$ and if a character is $1$ he can change it to $0$. Length of the string is $N$. Srikant has to change some characters in the string in such a way that the obtained string is diverse. The string is diverse if any two adjacent characters in the string are

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