← All problemsSign in

Chef and Binary Strings

Chef has a newfound love of playing with binary strings and numbers. A binary string is one made of only of 0s & 1s. Chef has found a new game with binary strings. He takes a binary string and applies several (possibly zero) operations to it. In one operation, Chef takes any two adjacent characters of a string, define one of them as C and the other as D. Then he calculates two values P & Q where

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