Citi Interview Question

How to solve difficult problem