It's obviously ellipsisessieses.
Inspired by a chat message.
Your challenge
Given a list or space or comma-separated string of words, ellipsisessiesesify them.
To ellipsisessieses-ify a word:
- Start with the word.
- Add the first letter of the original word to the end.
- Add 2 of the last letter of the original word to the end.
- Add the second-to-last letter of the original word to the end.
- Add the first letter of the original word to the end.
- Add the last letter of the original word to the end.
- Repeat steps 5 & 6 once.
- You're done!
You can assume:
- The input words will only be alphanumeric
- Input & output can be a space-separated string or list
- The input will contain only words
- The words will be at least 2 letters long
- The input will match the regex
/^[a-z0-9]{2,}( [a-z0-9]{2,})*$/i
- You can have a different input and output format
- More to come...
Test cases:
ellipsis -> ellipsisessieses
goat -> goatgttagtgt
covfefe -> covfefeceefcece
programmer5000 -> programmer5000p000p0p0
up vote down goat -> upuppuupup voteveetveve downdnnwdndn goatgttagtgt
it is golf yo -> itittiitit isissiisis golfgfflgfgf yoyooyyoyo
crossed out 44 is still 44 -> crossedcddecdcd outottuotot 4444444444 isissiisis stillslllslsl 4444444444
Shorteststtsstst answerarrearar ininniinin bytesbssebsbs winswssnwsws!