Test Case Errors

Hey…
Actually I wanted to know that what is the flaw in my approach ?

for upper_bound() return value will be
An iterator to the upper bound position for val in the range.
If no element in the range compares greater than val, the function returns last.

it means if element doesn’t exist then it doesn’t return n
it return n only when no element greater then val

so you first you have to explicitly check whether element exist or not

I did check and still it gives me an error for the same

NO,
after checking whether element exist or not all testcase will pass
Modified Code

check this