You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// When no more interesting kata can be resolved, I just choose to create the new kata, to solve their own, to enjoy the process --myjinxin2015 said
4
+
5
+
// Input
6
+
// An integer array nums that contains n*2 elements:
7
+
8
+
// [1,2,3,4,5,6]
9
+
10
+
// Output
11
+
// A 2D array that contains n elements. Each element is an subarray that contains two integers, and their sum must be a prime:
12
+
13
+
// [[1,2],[3,4],[5,6]]
14
+
15
+
// Note:
16
+
// You can assume that the length of nums always be an even number or 0(an empty array) and it always less than 20.
17
+
// All the integers are positive integers and less than or equals to 1000.
18
+
// You don't need to worry about the order of the output array. that is, There may be many kinds of combinations and sequences, you just need to return one of the effective combinations.
19
+
// If there is no possible solution, return []
20
+
// Examples
21
+
// primeSumPair([1,2,3,4,5,6]) can returns: [[1,2],[3,4],[5,6]]
22
+
// or: [[3,4],[5,6],[1,2]]
23
+
// or: [[1,4],[5,6],[2,3]]
24
+
// or ....
25
+
// primeSumPair([11,22,33,44,55,66]) should return []
0 commit comments