We kindly ask you to solve the following code challenge as part of our selection process.
An address provider returns addresses only with concatenated street names and numbers. Our own system on the other hand has separate fields for street name and street number.
Input: string of address
Output: string of street and string of street-number
-
Write a simple program that does the task for the most simple cases, e.g.
"Winterallee 3"
->{"Winterallee", "3"}
"Musterstrasse 45"
->{ "Musterstrasse", "45"}
"Blaufeldweg 123B"
->{"Blaufeldweg", "123B"}
-
Consider more complicated cases
"Am Bächle 23"
->{"Am Bächle", "23"}
"Auf der Vogelwiese 23 b"
->{"Auf der Vogelwiese", "23 b"}
-
BONUS: Consider other countries (complex cases)
"4, rue de la revolution"
->{"rue de la revolution", "4"}
"200 Broadway Av"
->{"Broadway Av", "200"}
"Calle Aduana, 29"
->{"Calle Aduana", "29"}
"Calle 39 No 1540"
->{"Calle 39", "No 1540"}
Your Task:
Write a running application in the programming language of your choice including test cases.