CHALLENGE: Unique Country Codes | Sololearn: Learn to code for FREE!
Novo curso! Todo programador deveria aprender IA generativa!
Experimente uma aula grƔtis
+ 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 Respostas
12th Apr 2018, 6:08 PM
VcC
VcC - avatar
12th Apr 2018, 6:34 PM
Kinshuk Vasisht
Kinshuk Vasisht - avatar
+ 1
Orion (ą¤“ą¤°ą¤¾ą¤Æą¤Ø) What should be the output for "united kingdom"? "un" or "uk" ?
12th Apr 2018, 5:20 PM
Kinshuk Vasisht
Kinshuk Vasisht - 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