You are viewing a single comment's thread. Return to all comments →
JavaScript Solution
arr.reduce((p,c,i) => { let num = i - 1; while (num >= 0) { if (arr[num] > c) p += 1; num --; } return p; }, 0);
Seems like cookies are disabled on this browser, please enable them to open this website
Running Time of Algorithms
You are viewing a single comment's thread. Return to all comments →
JavaScript Solution