Internationali­zation Puzzles

Sorting it out

It's your first day at DisruptoCorp, the hip new scale-up where everyone wants to work. You are excited to start here as an intern, get a foothold in the industry, to kickstart your career. Here you can learn all the latest trends in AI and blockchain. Or maybe they were doing something with Fintech? You're not really sure. Anyway, whatever it is, the company is young, hip and international, and you want to be there!

After obtaining your company laptop and keycard, you meet your supervisor, Clive Sinclair. He gives you your first assignment. The company is growing rapidly, and they need some structure. Nodoby knows who actually works here, so your first job is to visit all the open plan workspaces, breakout gardens and relaxation rooms, and make a list of names and phone numbers. Next, you must alphabetize the list and share it with everyone. The company is currently between intranet software systems, so in the meanwhile the preferred method of sharing the phonebook is by printing it out, and passing it around on paper.

Here are the first fifteen names you collect, plus their phone numbers. To make sorting easier, you write last names first, separated by a comma. Here is your test input1

Ñíguez Peña, María de los Ángeles: 0151605
Åberg, Rosa-Maria: 0110966
Öztürk, Zeynep: 0185292
van den Heyden, Harm: 0168131
Ämtler, Lorena: 0112717
Olofsson, Mikael: 0103652
van Leeuwen, Joke: 0172199
Vandersteen, Willy: 0120659
Østergård, Magnus: 0113959
van Leeuw, Floor: 0144158
Navarrete Ortiz, Dolores: 0119411
Aalto, Alvar: 0192872
Zondervan, Jan Peter: 0103008
Æbelø, Aurora: 0113267
O'Neill, Cara: 0109551

As you are now discovering, human names are just as chaotic and disorganized as your new employer.

Aalto, Alvar: 0192872
Åberg, Rosa-Maria: 0110966
Æbelø, Aurora: 0113267
Ämtler, Lorena: 0112717
Navarrete Ortiz, Dolores: 0119411
Ñíguez Peña, María de los Ángeles: 0151605
Olofsson, Mikael: 0103652
O'Neill, Cara: 0109551
Østergård, Magnus: 0113959
Öztürk, Zeynep: 0185292
van den Heyden, Harm: 0168131
Vandersteen, Willy: 0120659
van Leeuw, Floor: 0144158
van Leeuwen, Joke: 0172199
Zondervan, Jan Peter: 0103008

You sorted the list case-insensitive, ignoring accents, as is common in English, so Rodriguez < Röntgen < Roosevelt. You treat Æ as though it's written ae, so ad < æ < af. Another important rule for phonebooks is: letter by letter. You compare only letters, ignoring spaces, punctuation, and so on. That means Olofsson < O'Neill < Ortega and van Beijeren < Vandersteen < van Leeuwen

In this vein you complete the list, and share it around. Everything seems fine and you are happy that you've been able to do well on your first assignment. But the next day, something is off. You are asked to come to the office of the company Vice President, Per-Åke Åkesson. Mr. Åkesson gives you some sternly worded lessons in internationalization. The Swedish alphabet has 29 letters, and they are ordered A through X, then Y, Z, Å, Ä and Ö. Mr. Åkesson would expect his name to appear near the end, somewhere after Zondervan, Jan Peter, thank you very much! The letter Æ is considered the degenerate Danish variant of Ä, so Är < Æs < Ät, and Ø is an odd variant of Ö, so Ök < Øl < Öm

Distraught, you return to your desk and prepare a new list. With the new rules, it goes as follows:

Aalto, Alvar: 0192872
Navarrete Ortiz, Dolores: 0119411
Ñíguez Peña, María de los Ángeles: 0151605
Olofsson, Mikael: 0103652
O'Neill, Cara: 0109551
van den Heyden, Harm: 0168131
Vandersteen, Willy: 0120659
van Leeuw, Floor: 0144158
van Leeuwen, Joke: 0172199
Zondervan, Jan Peter: 0103008
Åberg, Rosa-Maria: 0110966
Æbelø, Aurora: 0113267
Ämtler, Lorena: 0112717
Østergård, Magnus: 0113959
Öztürk, Zeynep: 0185292

The next morning, you are called into the office of the CEO of the company, Joke van Leeuwen. She is much nicer than the VP, but nevertheless demands that you change the phonebook again. You see, Mr. Åkesson does not have final say in this matter. Mrs. van Leeuwen is his superior, and cares deeply about sorting rules. She explains that according to the Dutch sorting rules, infixes such as van and de should be ignored when sorting last names. Consequently, she would expect to look up her own last name under the L and not the V. Otherwise, one third of the Dutch phonebook would be under the letter V, and we wouldn't want that, would we? While you are left wondering what this means for Belgian phonebooks5, she also mentions that accented letters can be safely ignored, just as in English.

You quickly set to work to sort the list one more time. You're pretty fed up with all the conflicting requirements, but now that you got directions from the top, this should be final.

(To make things easier, here you can assume that the part of the last name leading up to the first capital letter can be treated as infixes. For example, in van den Heyden, you can recognize the first capital letter H as the proper start of the last name)

Aalto, Alvar: 0192872
Åberg, Rosa-Maria: 0110966
Æbelø, Aurora: 0113267
Ämtler, Lorena: 0112717
Leeuw, Floor van: 0144158
Heyden, Harm van den: 0168131
Leeuwen, Joke van: 0172199
Navarrete Ortiz, Dolores: 0119411
Ñíguez Peña, María de los Ángeles: 0151605
Olofsson, Mikael: 0103652
O'Neill, Cara: 0109551
Østergård, Magnus: 0113959
Öztürk, Zeynep: 0185292
Vandersteen, Willy: 0120659
Zondervan, Jan Peter: 0103008

Now to test that you've done everything correctly, from the three lists, find the very middle phone number, and multiply them together. In the example, that would be 0144158 * 0119411 * 0109551 = 1885816494308838

What is the product of the three middle phone numbers, after sorting according to English, Swedish and Dutch rules, of your full puzzle input?


  1. The test input was updated on 2025-03-18 15:30Z to cover an extra edge case. 

  2. This is a Spanish naming custom 

  3. Also called Tussenvoegsel 

  4. As can occur in Spanish composite given names 

  5. In Belgian phonebooks, 'V' is indeed the largest section. See: Dutch and Belgian surnames

To play, please log in with one of these options:
GitHub Login | Google Login