Citi interview question

camel/banana problem