Yandex Interview Question

Find running median