Uniform or non-uniform string prediction
CodeChefOpen on judge ↗
Akansha has a circular string of length N consisting solely of 0's and 1's. She needs to calculate the number of flips(0-1 or 1-0 transitions) that one has to make while making a single traversal over the string i.e. starting from any character and go circularly until (s)he gets back to the same character. The string is said to be uniform if there are atmost N/2 such flips, otherwise it is c
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