Domanda di colloquio di Airbnb

Leetcode binary search style question with a mathematical twist