AppLovin interview question

Had a leetcode medium problem