[Flax club trick OA] Reorder Prime and Non-Prime

Background story Packing: Each pure linen orders pick the first paragraph of the letter on behalf of prime order for the certification number, followed by; followed by the pure numbers represent non-prime order. Required to prime order lexicographically top surface, non-prime order applied to the tail in their original order.

 

Version two:

There is also a problem not seen with time trifle generous, and good to do another fast, this problem is not difficult, a little trouble. The problem is: there is a file, the total number of files. Each file has some information, there is a separate bucket number, and the second information is VERSION, VERESION new file is STRING, VERSION old files are digital. To put a new file security photo Version sort, the old file order unchanged, with the new file. 
I understand the problem with the high point of time, is not difficult. Version with a TreeMap to row a sequence on the line.

 

Example:

Input: {"a1 9 2 3 1","g1 act car","zo4 4 7","ab1 off key dog","a8 act zoo"}
Output: {"g1 act car","a8 act zoo","ab1 off key dog","a1 9 2 3 1","zo4 4 7"}

 

Ideas:

Exactly like https://www.cnblogs.com/liuliu5151/p/11026126.html  of solution

 

Guess you like

Origin www.cnblogs.com/liuliu5151/p/11026129.html