Challenge overview
Hello and welcome to the challenge!
You are going to participate in algorithmic challenge designed to showcase your technical skills.
Rocket Race is an event organized every year in the Challenge Galaxy. This is the biggest event for rocket fans in the space. This year there is a long narrow tunnel on the race track. It is impossible for a rocket to overtake other rockets in the tunnel. Therefore, a rocket has to lower its speed if there is a slower rocket in front of it.
You are given the maximum speed of N rockets in the order they entered the tunnel during the race. Each rocket moves at its maximum speed if it can. If that's is impossible because of the rocket in front, it might have to lower its speed. For the purpose of this problem, you can assume that the tunnel is infinitely long.
Your assignment is to say how many rockets can move at their maximum speed in the tunnel.
Click "Start test" to get the details of the assignment.
Have fun and good luck! :)