HomeX interview question

Mostly leetcode medium with some probability theory thrown in