Domanda di colloquio di Yandex

Algorithmic questions. Some were identical to leetcode ones.