Find number of pairs ( x , y ) in an array such that x ^ y > y ^ x |
public static int countPairsBruteForce ( int [ ] X , int [ ] Y , int m , int n ) { int ans = 0 ; for ( int i = 0 ; i < m ; i ++ ) for ( int j = 0 ; j < n ; j ++ ) if ( Math . Pow ( X [ i ] , Y [ j ] ) > Math . Pow ( Y [ j ] , X [ i ] ) ) ans ++ ; return ans ; }