Password
Practice
3.7 (92 votes)
Ad Hoc
Approved
Brute Force search
Data structures
Easy
Open
Problem
64% Success 18799 Attempts 20 Points 1s Time Limit 256MB Memory 1024 KB Max Code

Danny has a possible list of passwords of Manny's facebook account. All passwords length is odd. But Danny knows that Manny is a big fan of palindromes. So, his password and reverse of his password both should be in the list.

You have to print the length of Manny's password and it's middle character.

Note : The solution will be unique.

INPUT
The first line of input contains the integer N, the number of possible passwords.
Each of the following N lines contains a single word, its length being an odd number greater than 2 and lesser than \(14\). All characters are lowercase letters of the English alphabet.

OUTPUT
The first and only line of output must contain the length of the correct password and its central letter.

CONSTRAINTS
\(1 ≤ N ≤ 100\)

Please login to use the editor

You need to be logged in to access the code editor

Loading...

Please wait while we load the editor

Loading...
Results
Custom Input
Run your code to see the output
Submissions
Please login to view your submissions
Similar Problems
Points:20
45 votes
Tags:
Ad-HocApprovedEasyOpen
Points:20
2 votes
Tags:
AlgorithmsBasics of String ManipulationString Algorithms
Points:20
84 votes
Tags:
ApprovedEasyOpen