Rippling Interview Question

binary search- hard leetcode problem