Check my mistake

it is counting the value which is not present and upper bound output is wrong

hello @naaz
image
here first check whether key is present or not ( u can use inbuilt binary search function for the same).
if it is present then only apply lower and upper bound.

otherwise print - 1.