2774. Array Upper Bound
Hints
Hint 1
Inside the Array.prototype.upperBound function you have access to the "this" keyword. You can access array elements, values, and methods. For example "this[0]", "this[1]", "this.length", "this.map()", etc.
Hint 2
The most efficient way to solve this problem is with binary search.
Hint 3
Choose the middle element and check if it's less than or equal to the goal value. If so, you can rule out the left side of the array.
Preparing judge…