After finding reciprocal , check if the reciprocal is in A . P . To check for A . P . , first Sort the reciprocal array , then check difference between consecutive elements
rec . Sort ( ) ; int d = ( int ) rec [ 1 ] - ( int ) rec [ 0 ] ; for ( int i = 2 ; i < n ; i ++ ) if ( ( int ) rec [ i ] - ( int ) rec [ i - 1 ] != d ) return false ; return true ; }