Back to Browse

PYTHON Palindrome Reorder Algorithm - CSES Introductory Problems #12

620 views
Jun 3, 2020
5:21

Github: https://github.com/BunnyHeist/CSEC Given a string, your task is to reorder its letters in such a way that it becomes a palindrome (i.e., it reads the same forwards and backward). Input The only input line has a string of length n consisting of characters A–Z. Output Print a palindrome consisting of the characters of the original string. You may print any valid solution. If there are no solutions, print "NO SOLUTION". Constraints 1≤n≤106 Example Input: AAAACACBA Output: AACABACAA

Download

0 formats

No download links available.

PYTHON Palindrome Reorder Algorithm - CSES Introductory Problems #12 | NatokHD