Lowe and Upper bound of an element in array

For this problem ,is this given that the array will be sorted?else it wont work unless we sort the given array at first

@mbornfree93 Yes you have to sort the array first. Since it is not mentioned that array is sorted there can be a testcase in which array is not sorted.

yes thats what i thought . Thanks for the reply

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.