Peter And Haunted Garden
CodeChefOpen on judge ↗
Peter is a gardener. He has planted trees in a row each tree is denoted by character $'T'$. But some empty spaces are left between trees which are denoted by $'_'$. Peter wants to plant new trees in those spaces and he needs your help. You are given a string $S$ representing this garden. Find the position of empty spaces in the given string or print -1 if no empty spaces are present. ### Input -
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