This week's challenge: This week's challenge comes from listener Anjali Tripathi of Los Angeles, California. Take the last name of a Nobel Peace Prize winner. Remove the middle three letters and duplicate the last two letters to get the first name of a different Nobel Peace Prize winner. What are those two names? Again, take a Nobel Peace Prize winners last name, remove the middle three letters and duplicate the last two letters, get the first name of another Nobel Peace Prize winner.
If you solve the Sunday Puzzle regularly, you're probably thinking this one will be easy.
Why? Closed class! These puzzles generally ask us to take a thing from one class, perform some transformation on it and get a thing from some other class. In some cases, these classes are open: e.g., English girl's names or hit pop songs. In this case, we have a closed class--we can easily look up the list of Nobel Peace Prize winners and be certain that the solution is in that list.
So how do we solve this? We need:
- P: a list of all Nobel Peace Prize winners
- f: a function to take the last name of a winner, remove the middle three letters and duplicate the last two letters, and return the string
See you next week!