← 返回 google 的题目列表Rearrange Array to Avoid Prime Sums of Adjacent Elements
类型:online_judge
google
Given an array of positive integers, rearrange the elements so that the sum of any two adjacent elements is not a prime number. Implement a function to achieve this and provide the following test cases.
Example
Input
1 17 8 14