Pergunta de entrevista da empresa Google

A common problem from leetcode/CC150/any algorithm book.