Function to find gcd of array of numbers
static int findGCD ( int arr [ ] , int n ) { int result = 0 ; for ( int element : arr ) { result = gcd ( result , element ) ; if ( result == 1 ) { return 1 ; } } return result ; }