Domanda di colloquio di Comcast

How would you approach coding this prompt