it is counting the value which is not present and upper bound output is wrong
Check my mistake
hello @naaz

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.