Google Interview Question

Nothing too complicated.