Google Interview Question

ant triangle problem, binary search problem