Company: Barco_12nov
Difficulty: medium
Sum of Array Problem Description Peter has an integer array A of size N. He must perform the operations listed below: 1. Update all the elements of array A with the GCD (Greatest Common Divisor) of A[i] and the largest element in the subarray A[0] to A[i]. 2. After completing Operation 1, Peter must group the elements so that the largest element is grouped with smallest element and the second largest with second smallest and so on. 3. Now he must find out the GCD of each group and insert their resultant value in a new array B. Your task is to help Peter find and return an integer value, representing the sum of array B, after completing all the above operations. Constraints - N is always even. - The value of i ranges from 0 to N-1. Input Specification input1: An integer value N, representing the size of the array A. input2: An integer array A. Output Specification Return an integer value, representing the sum of array B. Examples Example 1: Input: input1: 4 input2: {1,14,11,19} Output: