Short message service (SMS) has become a fast and quick method for communication. Most service providers place a restriction on the size of messages and hence it is important to write concise messages. Mobile phone users have found methods for compressing their messages such that the content of the messages remains unaltered. One such method is to take the original message and remove all interior vowels from each word. A vowel is interior if there is at least one consonant to the left and right (not necessarily adjacent) of the vowel in the same word.
Given a String originalMessage with words separated by spaces return the compressed version of the message.
|