Skip to content

Commit 274bcc0

Browse files
committed
Runtime: 629 ms (Top 35.29%) | Memory: 80.4 MB (Top 80.39%)
1 parent 795787b commit 274bcc0

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

scripts/algorithms/K/K Radius Subarray Averages/K Radius Subarray Averages.js

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
1+
// Runtime: 629 ms (Top 35.29%) | Memory: 80.4 MB (Top 80.39%)
12
var getAverages = function(nums, k) {
23
const twoK = 2 * k;
34
const windowSize = twoK + 1;
4-
5+
56
const result = [...nums].fill(-1);
67
let sum = 0;
78
for (let i = 0; i < nums.length; i++) {
@@ -12,4 +13,4 @@ var getAverages = function(nums, k) {
1213
}
1314
}
1415
return result;
15-
};
16+
};

0 commit comments

Comments
 (0)