Bank of America interview question

Very basic level algorithm questions