Apple interview question

Study leetcode medium and hard