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.
achutpatil123 patil
2mo
ninja encrpts secret problem
Help your peers!
Add answer anonymously...
Top Capgemini Data Analyst interview questions & answers
Popular interview questions of Data Analyst
Top HR questions asked in Capgemini Data Analyst
Stay ahead in your career. Get AmbitionBox app
Helping over 1 Crore job seekers every month in choosing their right fit company
65 L+
Reviews
4 L+
Interviews
4 Cr+
Salaries
1 Cr+
Users/Month
Contribute to help millions
Get AmbitionBox app