Palindrome pairs

From Rosetta Code

Task deleted pending original task writer giving some indication that the same task on leetcode and here have no plagiarism issues.