Ninja and His Secret Information Encoding Problem

Ninja, a new member of the FBI, has acquired some 'SECRET_INFORMATION' that he needs to share with his team. To ensure security against hackers, Ninja decides to encode the information before sharing it. The goal is to help Ninja and his friends with the process of encoding and decoding the 'SECRET_INFORMATION'.

Input:

The input starts with an integer 'T', representing the number of test cases. Each of the next 'T' lines contains a string 'STR', which is the 'SECRET_INFORMATION' for that test case.

Output:

For each test case, determine if the encoding and then decoding process of the 'SECRET_INFORMATION' is successful. Print 'Transmission successful' if the decoded string matches the original 'SECRET_INFORMATION'. Otherwise, print 'Transmission failed'. Each result should be printed on a new line.

Example:

Suppose the input is:

2
hello
abc123

The output should be:

Transmission successful
Transmission successful

Constraints:

  • 1 <= T <= 100
  • 1 <= |SECRET_INFORMATION| <= 5000

Note:

The 'SECRET_INFORMATION' might contain any ASCII character. Do not use class members, global/static variables, or built-in library functions for decoding.

AnswerBot
4mo

The task is to determine if the encoding and decoding process of 'SECRET_INFORMATION' is successful.

  • Read the number of test cases 'T'

  • For each test case, encode the 'SECRET_INFORMATION' and then decode...read more

Help your peers!
Select
Add answer anonymously...

Top Trainee Analyst Interview Questions Asked at Cognizant

Q. What is the highest background
Q. Minimum Stops for Ninja's Journey Problem Statement Ninja wishes to travel from ...read more
Q. Black Friday Discount Challenge Imagine it's Black Friday and a supermarket is o...read more
Trainee Analyst Interview Questions
Stay ahead in your career. Get AmbitionBox app
play-icon
play-icon
qr-code
Trusted by over 1.5 Crore job seekers to find their right fit company
80 L+

Reviews

10L+

Interviews

4 Cr+

Salaries

1.5 Cr+

Users

Contribute to help millions

Made with ❤️ in India. Trademarks belong to their respective owners. All rights reserved © 2025 Info Edge (India) Ltd.

Follow Us
  • Youtube
  • Instagram
  • LinkedIn
  • Facebook
  • Twitter
Profile Image
Hello, Guest
AmbitionBox Employee Choice Awards 2025
Winners announced!
awards-icon
Contribute to help millions!
Write a review
Write a review
Share interview
Share interview
Contribute salary
Contribute salary
Add office photos
Add office photos
Add office benefits
Add office benefits