You are given an integer array nums of length n.
Construct an array prefixGcd of size n, where prefixGcd[i] is the greatest common divisor (nums[i] and the maximum value in nums from index
Sort prefixGcd in non decreasing order. Then, form pairs by pairing the
Return the sum of the greatest common divisor of each formed pair.
Constraints:
nums.length
nums[i]
You are given an integer array nums of length n.
Construct an array prefixGcd of size n, where prefixGcd[i] is the greatest common divisor (nums[i] and the maximum value in nums from index
Sort prefixGcd in non decreasing order. Then, form pairs by pairing the
Return the sum of the greatest common divisor of each formed pair.
Constraints:
nums.length
nums[i]