After finishing your last CodeFight of 2015 you suddenly realize: the New Year is almost here! To share your excitement, you want to send a New Year's wishp
to the community.
You think your message should look nice, so you decide to put it into a frame of asterisks ('*'
), with each word on a separate line.
Write a function that returns a framed wish
as an array of strings, where each string is a word of the wish
(including any punctuation marks that might come right after it) with some spaces added to make the frame rectangular. Note that there should be exactly 1
whitespace character (' '
) before each word, and at least 1
after.
For wish = 'Happy New Year and CodeFight On in 2016!' the output should be
happyNewYear(wish) = ['*************',
'* Happy *',
'* New *',
'* Year *',
'* and *',
'* CodeFight *',
'* On *',
'* in *',
'* 2016! *',
'*************']
- [input] string wish
- Your wish that has at least one word.
- [output] array.string
- The framed version of your wish.