Jio interview question

Implementing upper_bound() and lower_bound() in Java