UPPER BOUND DOUBT STL

if element not found in the array in case of upper bound then the answer returns the size of array and if element is found at the last position then answer also returns the size of an array so how do we know that the element is present or not in upper bound…

hi @bhardwajsaksham796 size of array is n and last element which can be found will be at n-1 position, and to check if element is present u can use binary search function provided