Exists a Number Higher?

Published by Helen Yu in

Write a function that returns true if there exists at least one number that is larger than or equal to n.

Examples

exists_higher([5, 3, 15, 22, 4], 10) ➞ true

exists_higher([1, 2, 3, 4, 5], 8) ➞ false

exists_higher([4, 3, 3, 3, 2, 2, 2], 4) ➞ true

exists_higher([], 5) ➞ false

Notes

Return false for an empty array [].

Watch a quick demo on how Edabit works.