K Sized Subarray Maximum Leetcode Javascript