Up and Down
CodeChefOpen on judge ↗
Sai gave his friends a task as he was busy traveling. His boss has ordered him to make the sales of the company stable. Sai works for a sales company, and daily sales are kept in records. In order to show a good image of the company the boss ordered to make the sales stable, that is the number of times sales are UP(sales go high) and DOWN(sales go low) is equal. The sales statistics of a day is
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