Apple Interview Question

An easy level leetcode question