Apple interview question

2 Leetcode Questions