← All problemsSign in

Race to White

A Wall is divided into some strips, and each strip is painted either **Black or White**. In other words, a **String S** is given consisting of characters **B** or **W**. The Character at i-th position indicates the colour of the i-th strip of the Wall **(B for Black, W for White)**. Chef wants to colour the wall in such a way that **all the strips are of White colour**. Chef can do one of these t

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