Bank of America Interview Question

Very simple algorithm questions