You are a member of CIA. And your duty is to decrypt encrypted data sent by the spy of Iraq. They send four strings. 2nd one is a subsequence of 1st one and 4th one is reverse subsequence of 3rd one. To decrypt the message you need to replace each subsequence position of the 4th string at 3rd string by corresponding value of 2nd string at 1st string. Take a look at the example:-

1st string:– Do is hide nor aotomata sink
2nd string: – Dish not mask
3rd string: – Mile Saw Odeaa at Nopdh Bagdad turtlik FroGay.
4th string: – Goklrutp pedl

The decrypted data is:– Mike Saw Osama at North Bagdad on this Friday.

Some times the message may be corrupted, you must check if the 2nd and 4th are subsequence or not. If not print error message or print the decrypted line.

Use string header file to do the task.

Recommended Answers

All 4 Replies

Show some work or at least describe your strategy for solving the problem and you might get help.

Wow! That's the lamest "encryption" I've ever seen, hardly even a cipher.

khankir polara strategy chudao....oita jale ki ar toder kase ashi.

NSA does decryption, not CIA.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.