Draft

Arrange palindrome

10 of 11davidNge

Description:

Given an array of numbers, re-arrange them in such a way that it is palindrome.

From wikipedia: A palindrome is a word, phrase, number, or other sequence of characters which reads the same backward or forward.

Example input: [12,12,10,10,8], Expected output: [12,10,8,10,12]

Example input: [1,1,2,2,3,3,4], Expected output: [3,2,1,4,1,2,3]

Example input: [7,7,7,7,3,3,2,2,4,5,5], Expected output: [7,7,5,3,2,4,2,3,5,7,7]

There are 2 rules:

  1. All input for test cases can be re-arranged into a palindrome.

  2. With the exception of the array element at the center, the outer most array element is the largest integer, and is in descending order as it gets closer to the center.

More By Author:

Check out these other kata created by davidNge

Stats:

CreatedJan 30, 2016
Warriors Trained25
Total Skips0
Total Code Submissions81
Total Times Completed11
JavaScript Completions10
Ruby Completions2
Python Completions1
Total Stars2
% of votes with a positive feedback rating0% of 0
Total "Very Satisfied" Votes3
Total "Somewhat Satisfied" Votes0
Total "Not Satisfied" Votes1
Ad
Contributors
  • davidNge Avatar
  • GiacomoSorbi Avatar
Ad