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 encode and decode 'SECRET_INFORMATION' for security purposes and determine if the transmission was successful.

  • Read the number of test cases 'T'

  • For each test case, encode the 'SECRET_INF...read more

achutpatil123 patil
7mo
ninja encrpts secret problem
Help your peers!
Select
Add answer anonymously...

Capgemini Data Analyst interview questions & answers

A Data Analyst was asked 3mo agoQ. What are the different methods for masking data?
A Data Analyst was asked 6mo agoQ. How do you use field parameters in dynamic reporting?
A Data Analyst was asked 7mo agoQ. Define join and its types.

Popular interview questions of Data Analyst

A Data Analyst was asked 6mo agoQ1. How do you use field parameters in dynamic reporting?
A Data Analyst was asked 7mo agoQ2. Define join and its types.
A Data Analyst was asked Q3. How is Java platform independent?
Capgemini Data 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