FunctionRacerProblemsRace

Close Enough

EasyNumPyPython

Return True if every pair a[i], b[i] differs by at most tol (that is, |a[i] - b[i]| <= tol for all i), otherwise False. Both arrays have the same length.

Example 1

a [1,2,3]
b [1,3,3]
tol 1
returns true

The biggest difference is 1, which is allowed.

Constraints

Race itor take your time

Write it in your browser, against the clock. The model solution, stepped through line by line, comes after.

More NumPy problems