ASUS Interview Question

Similar to LeetCode with some follow up