Given an array of integers nums and an integer k, determine the maximum GCD sum among all subarrays with a length of at least k.
The GCD sum of a subarray is defined as the greatest common divisor of all elements in that subarray multiplied by the sum of all elements in that subarray.
Return the maximum GCD sum that can be obtained.
Note: A subarray is a contiguous sequence of elements within an array.
Constraints:
n nums.length
n
nums[i]
k n
Given an array of integers nums and an integer k, determine the maximum GCD sum among all subarrays with a length of at least k.
The GCD sum of a subarray is defined as the greatest common divisor of all elements in that subarray multiplied by the sum of all elements in that subarray.
Return the maximum GCD sum that can be obtained.
Note: A subarray is a contiguous sequence of elements within an array.
Constraints:
n nums.length
n
nums[i]
k n