← All problemsSign in

Ponyo and his running machine

Problem statement Ponyo is working on a machine which records the maximum duration one can run in a stretch. The machine is fed with data in the form of a sequence of 'R' and 'S' where R stands for running and S stands for stopped where each 'R' or 'S' stands for runner's state at that second. Write a program for Ponyo's machine which will record the maximum duration one can run at a stretch. N

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