NoBroker interview question

Data Structure