Airbnb Interview Question

Leetcode binary search style question with a mathematical twist