Pregunta de entrevista de Name.com

A coding question to solve a problem