Pergunta de entrevista da empresa Yandex

2-3 medium leetcode problem for each coding interview. 1 hard problem for additional interview(as I found out later, I was assigned it because I received "no hire" for the ML section.