Dropbox Interview Question

Leetcode question, then code review