Find GCD of all Array numbers for which its value is equal to its frequency
Given an array arr[] of integers N, the task is to find the GCD of all numbers for which it's value is equal to its frequency in the array. Examples; Input: arr={2, 3, 4, 2, 3, 3} N=6 Output: 1Explanation: Here 2 is occurring 2 times and 3 is occurring 3 times. Hence GCD of 2, 3, is 1. So our output is 1. Input: arr={2, 3, 4, 4, 3, 5, 4, 4, 2, 8} N