Question d’entretien chez Comcast

How would you approach coding this prompt