Kind Thief
CodeChefOpen on judge ↗
Arthur is a famous thief in the town. He does not differentiate RICH and POOR while looting their houses but he has a soft heart for poor people. So he made a rule that he will not loot more than 1 houses of poor people. You are given a string $'PPRPRRRPRR'$ where $P$ denotes the house of poor people and $R$ denotes the house of Rich people. Help Arthur by finding a maximum continuous sub-segment
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