Dolby interview question

2 leet code easy algo question and 1 medium