Loading...
Loading...
Loading...
Print yes if a list is in non-decreasing order (each item is at least as large as the one before it), and no otherwise. Equal neighbours are allowed. The starter holds a program with a bug. Find it and fix it.
yes or no.Example 1
Input
4 1 2 2 5
Output
yes
Equal neighbours are fine.
Example 2
Input
3 3 1 2
Output
no
Try the problem first. Open one hint at a time.
Compare each item with the next one.
Which comparison must be false for a pair to break the order?
Write your Python code, run it on the examples and submit it to hidden tests.
Solve in the editor