Given an integer array nums and an integer k, determine the number of subarrays of nums where the greatest common divisor of all elements in the subarray equals k.
Note:
A subarray is defined as a contiguous sequence of elements within an array.
The greatest common divisor of a sequence of integers is the largest positive integer that divides each integer in the sequence without a remainder.
Constraints:
nums.length
nums[i], k
Given an integer array nums and an integer k, determine the number of subarrays of nums where the greatest common divisor of all elements in the subarray equals k.
Note:
A subarray is defined as a contiguous sequence of elements within an array.
The greatest common divisor of a sequence of integers is the largest positive integer that divides each integer in the sequence without a remainder.
Constraints:
nums.length
nums[i], k