Shortest Palindromic Substring ENCODING APRIL 20 Problem Code: ECAPR201

In this question we have to print lexicographically smallest pallendromic substring
but i have written a code to print a char which is lexicographically smallest and it is accepting with AC .Can someone make me clear about the question whether i am unable tho understand question or there is a problem in one.
my solution ::

1 Like

A single char is also a palindrome.


it mean we just have to give lexicographically smallest letter only?

exactly you just have to print lexicographically smallest letter present


a single char is also a palindrome and here it necessarily means a single character there may be several palindromes present in a string we need to print lexicographically smallest. for example s=“abab”, here we have many palindromic substring but smallest one is a.

1 Like