CAKE_GLIDE
CodeChefOpen on judge ↗
You are given a String $S$ of length $N$. You can perform $K$ operations on the String. In each operation, you can swap the $i$th character with the $(i+1)$th character. A subtring in S is considered precious if it starts at an index $i$ such that - the size of the substring is atleast $M$ - the substring consists only of 1's - No other String can be formed satisfying the above two conditions wher
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