0
/ 10
Given an array of integers, return the first element in the array that is larger than maxVal
. Assume the array has only posivitive...
Given an array of integers, return the first element in the array that is larger than maxVal
. Assume the array has only posivitive numbers. If no value in numbers
is larger than maxVal
, then return maxVal
.
Examples:
largerThan({0,1,2,5},3) -> 5
largerThan({10,2,4},2) -> 10
Your feedback will appear here when you check your answer.