Japt, 18 bytes
®ou qÃov
ò mq'_ q-
Input as an array of character arrays.
Explanation:
®ou qÃov
® Ã # For each word in the input:
ou # Convert the last letter to uppercase
q # Join to a string
o # For the last word:
v # Convert it to lowercase
# Save as U
ò mq'_ q-
ò # Cut U into pairs of words
m # For each pair:
q'_ # Join to a single string with "_" in between
q- # Join all those strings with "-" between
Kamil Drakari
- 4.4k
- 12
- 21