We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 57010ef commit 8cc0516Copy full SHA for 8cc0516
scripts/algorithms/A/Array Partition/Array Partition.js
@@ -1,8 +1,9 @@
1
+// Runtime: 211 ms (Top 22.61%) | Memory: 47.1 MB (Top 91.83%)
2
var arrayPairSum = function(nums) {
3
nums.sort((a, b) => a - b);
4
let total = 0;
5
for (let i = 0; i < nums.length; i += 2) {
6
total += Math.min(nums[i], nums[i + 1]);
7
}
8
return total;
-};
9
+};
0 commit comments