Welcome SHASHANK SHEKHAR Home Coding Arena Compile & Run Submissions Graphs Feedback
Time Left
Coding Arena 00 02 32
Change Default Language hr min sec
A B C D E F
Output Format:
A sorted list of all palindromes constructed from the given string. Each line should contain one palindrome.
Example 1
Input
NITIN
Output
INTNI
NITIN
Explanation
There are only two palindromes that can be constructed from NITIN
Example 2
Input
ABC DC BA
Output
ABC DC BA
AC BDBC A
BAC DC AB
BC ADAC B
C ABDBAC
C BADABC
Explanation
Since there is only one D, it can only be the middle letter in the palindrome. The remaining lettere A, B, C can be arranged
in 6 possible ways and each way gives rise to a palindrome.
Note:
Please do not use package and namespace in your code. For object oriented languages your code should be written in one
class.
Note:
Participants submitting solutions in C language should not use functions from <conio.h> / <process.h> as these files do not
exist in gcc
Note:
Submit Answer
Select Language
Select File
Browse...
https://www.tcscodevita.com/CodevitaV6/problemstart.jsp 1/2
7/29/2017 TCS: CodeVita - Coding Arena
2017 Tata C onsultancy Services Limited. All Rights Reserved. In Association with | Privacy Policy
https://www.tcscodevita.com/CodevitaV6/problemstart.jsp 2/2