Yahoo Interview Question

7 LeetCode easy/medium, brain teaser