#K63992. Palindromic Words Finder
Palindromic Words Finder
Palindromic Words Finder
Given a sentence \(S\) consisting of words separated by spaces, your task is to find and output all palindromic words in the sentence. A word is considered a palindrome if it reads the same forwards and backwards when case is ignored. The palindromic words must be printed in lexicographical order (ignoring case). If no palindromic word exists, output No palindromes found
.
Note:
- The input sentence may contain leading, trailing, or multiple spaces between words.
- Output the palindromic words separated by a single space.
Example:
Input: Anna went to see civic raceCar dads Output: Anna civic raceCar</p>Input: Hello world from Python Output: No palindromes found
inputFormat
The input consists of a single line representing the sentence \(S\).
Input Format:
A single line containing the sentence
outputFormat
If there are palindromic words, print them in a single line separated by a space, sorted in lexicographical order ignoring case. Otherwise, print No palindromes found
.
Anna went to see civic raceCar dads
Anna civic raceCar