sort array given order | shawnlincoding
第二题:给定两个array,一个是actual numbers, 另一个是position array, 按照position array将actual number array排序。
例子:
actual number array : [4 2 1 5 3]
position array : [3 1 0 4 2]
=>
actual number array变成 [1 2 3 4 5]
Read full article from sort array given order | shawnlincoding
No comments:
Post a Comment