Is there an implied “rule” that we shouldn’t be using built-in objects/methods/etc. to accomplish this (or any other) problem in the course? Or is it that the provided solutions are the most optimal in terms of memory and/or performance? For example, the code I submitted passed all the test cases, but is it not performant?
Course / problem: Educative: Interactive Courses for Software Developers
let findMaxSlidingWindow = function(nums, windowSize) {
let result = [];
let windowValues = [];
for (let i = 0; i <= nums.length - windowSize; i++) {
windowValues = nums.slice(i, i + windowSize);
result[i] = Math.max(...windowValues);
}
return result;
};