Suppose I have a sorted array of integers int[]
, and I want to search the closest smaller value to some input number.
for example if the array contains (1) , (23), (57) , (59), (120) and the input is 109, the output should be 59.
I am just trying to see suggestions and compare to the approaches I already have.