Pregunta de entrevista de Google DeepMind

Straight in the interview I was asked a coding question leetcode style.