This week’s code-crunch was straight from a real-life love story! Arun had the best answer to the code-crunch on:
A guy is seeing his sister’s friend secretly. He would sometimes text her but she wouldn’t reply if his sister is around,as she is afraid she might look at her messages. So he decides to use a simple encryption method to encrypt his messages.
According to the encryption method:
1 letter words are sent as is. eg.: I => I, u => u
2 letter words are shifted one letter to the right. eg.: is => si, me => em, to => ot
3 or more letter words are shifted two letters to the right. eg.: are => rea, you => ouy, meet => etme, movie => iemov
Space is any alphabet repeated thrice. eg.: uuu, xxx, ppp are Spaces.
Given an encrypted string, write code to find the decrypted string/message.
Sample Input: reaoooummmeefrkkkhttonigooo
Expected Output: are u free tonight