Bloomberg Interview Question

Similar to Find in Mountain Array LC