I have a sorted array, the first value is always equal or grater than 1, and I need to find the index of the element most to the left, which is equal or greater than N
.
[1, 3, 3, 4, 5, 7, 11, 11, 12, 15]
What I need is a recursive binary search function that finds the expected element, so in the example, when N
is equal to 11
, it returns 6
as an output.