← All problemsSign in

Potholes

A Biker has to keep records of all the potholes in his route of supposing $X$ steps. The steps are of two types Up and down represented as $U$ and $D$ respectively. A pothole is generally a step sequence when we go down from ground level and reach up back to ground level this exactly 1 pothole. You are given the sequence of Steps. Find out the no of potholes in his way. ###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.

voice by Sarvam AI

Sign in to chat with the tutor and save your progress.

Sign in to start