Range Check
MediumAcc. 93.4%
+25 XP 10
Global Validity
Check if every single number in the array is between min and max (inclusive).
The Assignment
Your function receives an array nums, a min, and a max.
- Use a loop to scan the array.
- If any element is found outside the range, print false and exit.
- If the entire loop finishes without exit, print true.
01EXAMPLE 1
Input
nums=[5, 10], min=1, max=10Output
trueExplanation: All are in range.
Constraints
- Return a boolean string.
- Stop early on the first violation.
ArraysLogic
JavaScriptSystem handles I/O — write your function only
Loading...
2 Hidden
Input Arguments
nums[5,10]
min1
max10
Expected Output
true
Click RUN to test your solution