The current coronavirus disease is officially named COVID-19, from the 3 words corona virus disease, and the year 2019. (Technically it's coronavirus, making 2 words, but whatever...)
Given this example, we can apply this naming convention to name other potential diseases.
You will be given 3 words and a year.
- Take the first letters of the first 2 words, up to and including the first vowel, and append them together.
- Then, append the first letter of the 3rd word.
- Finally, append the character
-, followed by the last 2 digits of the year.
corona,virus,disease,2019 -> co + vi + d + - + 19 -> covid-19.
- It is guaranteed that each of the three words have at least one vowel. For the purposes of this challenge, vowels are defined as the letters
a, e, i, o, u.
- You may assume that words consist only of lowercase letters
a-z, or only uppercase letters
A-Zif you prefer. Your output may be in either case.
- It's guaranteed that the date is exactly four digits.
- Input may be specified in any format, as long as there is a delimiter between the words. For example,
['corona', 'virus', 'disease', '2019'],
[['corona', 'virus'], 'disease', 2019]and
corona virus disease 2019are all valid inputs.
This is code-golf, so shortest answer wins.
Example test cases
corona,virus,disease,2019 -> covid-19 computer,addiction,syndrome,1970 -> coas-70 code,golf,fun,2020 -> cogof-20 a,ba,ca,1234 -> abac-34 tree,string,create,9000 -> trestric-00 love,time,cholera,1985 -> lotic-85