← All problemsSign in

Monica and toys

Monica has many toys and she has a weird obsession of arranging all the toys in a line such that their heights are in non-decreasing order. If the order is messed then she gets angry. You know the number of toys and their current arrangement, can you tell if she is angry or not? Input First line will contain n the number of toys Monica has. Next line contains n integers, denoting the heights of

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