← All problemsSign in

Warriors

###Problem description. There are a number of warriors in a garden. Each of these warriors has a certain value of strength. After each day, if any warrior has more strength than the warrior on its left, being weaker than the left one, it dies. You are given the initial values of the strengths in each of the warriors. Print the number of days after which no warrior dies, i.e. the time after which

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