Upper and Lower bound problem

Here is my code:


Only one testcase is passing.

@S15
hello siddhant,
there is one logical error in ur code.
if key is not present in array then lower bound and upper bound will return iterator which is greater than the key which need not to be the end

for example if array is 1 2 4 5 and key=3 then lower/upper bound will return iterator of 4 which is clearly not equal to end.

to rectify it first check whether key is there in array or not and then apply lower/upper bound accordingly