All Tracks Problem

Spell of Doom
No tags

You have enjoyed a month of holidays.Now you decide you need something adventurous, something out of the box.So you embark on a long journey to Sazaxobenivisez, the mystical place from where no one has ever returned to tell its tales.So now you having traveled quite a distance, and have lost your sense of directions.It is getting dark.Now, you wish you could have avoided this path to death.Now, out of nowhere comes a witch.She says "If you can reverse my spells, I will help you reach the outside world else I shall have you as my dinner.Having no other option you decide to reverse her spells...

The witch casts two spells at a time.You can reverse them(exactly two spells at a time) by merging them into one spell by overlapping the suffix of the first spell and the prefix of the second spell and cast it on her. If you can't find a reverse spell by the above method, you can concatenate the spells and reverse them.

"Happiness can be found, even in the darkest of times, if one only remembers to turn on the light."-Dumbledore

pakoper perxxpa

If witchs first spell is"cesario" and second spell is "oputera", the reverse spell(output) is"cesarioputera".

Note: The spells overlap by the character 'o', making the answer "cesarioputera".

- Input Format:

first_spell second_spell (Spells are space separated)

- Output Format:


Time Limit: 5.0 sec(s) for each input file.
Memory Limit: 256 MB
Source Limit: 1024 KB

Best Submission

Similar Problems


Initializing Code Editor...
View All Notifications