Question d’entretien chez Optum

Medium level coding question based on strings