I have a problem where I need to find a palindrome with lowest lexicographical value from the Input string.
Sample input- Sample output-
aabcc acbca
Explanation- Out of all the palindromes cabac and acbca, acbca is lowest lexicographically.
P.S- I want to do it in java.
Aucun commentaire:
Enregistrer un commentaire