← back to unit
Easy
# sorting easy
Are the Books in Order?
The librarian numbered every book, and the shelf should go up as you read left to right. 📚
You get the shelf as a list of nums. Print in order if each number is at least as big as the one before it, otherwise mixed up.
Example:
Input: nums = [3, 7, 7, 12]
Output: in order
Each number is at least as big as the one before it (3≤7, 7≤7, 7≤12), so nothing breaks the flag — print in order.
💡 need a hint?
sort-books-in-order.py🔒 given lines are locked — write your code in between
loading...