Yandex interview question

Basic data structures and algorithms