leetle

Daily challenge for 2026-10-22

660. Shelf Safety Margins

You are given a non-decreasing sorted list of integers positions representing item coordinates on a storage shelf, and two integers min_safe and max_safe defining an inclusive safety range [min_safe, max_safe].

Return true if every position in positions falls within the permitted safety range, or false otherwise. If positions is empty, return true.

Constraints:
There are 0–2,000 sorted positions, including possible duplicates. Positions and safety bounds are integers with absolute value at most 1,000,000, and min_safe <= max_safe.

Example:
Input: positions = [12, 15, 18, 20], min_safe = 10, max_safe = 25
Output: true

Run this challenge interactively in Python or JavaScript when the app loads.