+ 1

CHALLENGE: Unique Country Codes

Given a list of countries names like ["australia", "austria", "truky", "turkmenistan", "united kingdom"] Write a program that will output 2 character long unique code for a country like "au" for australia and "as" for austria and so on. Note the first character of the code should also be the first character of the country's name, and the sequence of the code should also follow the sequence of the character in country's name, like for countries with same char: "au" for 1st & "as" for 2nd not "at" or "ar"

12th Apr 2018, 4:47 PM
OR!ON 🛡️
OR!ON 🛡️ - avatar
5 Answers
12th Apr 2018, 6:08 PM
VcC
VcC - avatar
12th Apr 2018, 6:34 PM
Solo Wanderer 4315
Solo Wanderer 4315 - avatar
+ 1
Orion (ओरायन) What should be the output for "united kingdom"? "un" or "uk" ?
12th Apr 2018, 5:20 PM
Solo Wanderer 4315
Solo Wanderer 4315 - avatar
+ 1
nice VcC
14th Apr 2018, 3:15 PM
OR!ON 🛡️
OR!ON 🛡️ - avatar
+ 1
My try 😎 #readable 😜 https://code.sololearn.com/cE5EpK9oVdZ4/?ref=app
16th Apr 2018, 6:14 PM
OR!ON 🛡️
OR!ON 🛡️ - avatar