Pregunta de entrevista de Scott Logic

General coding and logic questions/puzzles