Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function ReOrder(vector, vectors){
- var pom = 0;
- var index = 0;
- var j = 0;
- var pole = [];
- vectors.forEach(function(vect){
- vect.forEach(function(x){
- pom += (vector[index] - x);
- index++;
- });
- var item = [pom, vectors[j++]];
- pole.push(item);
- pom = 0;
- index = 0;
- });
- pole = pole.sort();
- return pole.map(item => item[1]);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement