Shipsy interview question

Basic data-structure & algorithms