From 06922738b735ac453245e72621c54a8ccea4f3c6 Mon Sep 17 00:00:00 2001 From: Jack Sangdahl Date: Fri, 14 Feb 2025 12:03:50 -0700 Subject: 1755. palindrome reorder --- introductory_problems/readme.md | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'introductory_problems/readme.md') diff --git a/introductory_problems/readme.md b/introductory_problems/readme.md index 6b0fb82..4fee2d6 100644 --- a/introductory_problems/readme.md +++ b/introductory_problems/readme.md @@ -76,3 +76,10 @@ You have two coin piles containing `a` and `b` coins. On each move, you can eith **Input**: The first input line has an integer `t`: the number of tests. After this, there are `t` lines, each of which has two integers `a` and `b`: the numbers of coins in the piles. (Example: 3`\n`2 1`\n`2 2`\n`3 3) **Output**: For each test, print "YES" if you can empty the piles and "NO" otherwise. (Example: YES NO YES) + +### Palindrome Reorder +Given a string, your task is to reorder its letters in such a way that it becomes a palindrome (ie. it reads the same forwards and backwards). + +**Input**: The only input line has a string of length `n` consisting of characters A-Z. (Example: AAAACACBA) + +**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 SOLUTIONS". (Example: AACABACAA) -- cgit v1.2.3