Pergunta de entrevista da empresa Bloomberg

Don't remeber the first problem but second was on 2D binary search