Code I wrote for an interview loop. The question was theirs, the code is mine.