# searching advanced

Find the Smallest Number At Least X

You need the cheapest gift that still costs at least x β€” gift cards below the minimum look stingy! 🎁

You get a SORTED list of prices and the minimum x. Print the smallest price that is x or more, or none if every price is too small.

Example:

Input: prices = [5, 15, 25, 40], x = 18 Output: 25

The boundary search finds the first price that's 18 or more, which is 25.

πŸ’‘ need a hint?

srch-ceiling.pyπŸ”’ given lines are locked β€” write your code in between
loading...