Beautiful String
CodeChefOpen on judge ↗
Rohini has been given a binary string 'STR' containing either '0' or '1'. A binary string is called beautiful if it contains alternating 0s and 1s. For example:'0101','1010','101','010' are beautiful strings. She wants to make 'STR' beautiful by performing some operations on it. In one operation, Rohini can convert '0' into '1' or vice versa. Your task is to determine the minimum number of ope
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.
Sign in to chat with the tutor and save your progress.
Sign in to start