public int countPairs(int X[],int Y[]){
        Map<Integer,Integer> hardCoded = new HashMap<Integer,Integer>();
        for(int i=0; i < Y.length; i++){
            if(Y[i] < 4){
                Integer count = hardCoded.get(Y[i]);
                if(count != null){
                    hardCoded.put(Y[i], count++);
                }else{
                    hardCoded.put(Y[i], 1);
                }
            }
        }
        Arrays.sort(Y);
        int countPairs = 0;
        for(int i=0 ; i < X.length; i++){
            countPairs += count(X[i],Y,hardCoded);
        }
        return countPairs;
    }
http://www.geeksforgeeks.org/find-number-pairs-xy-yx/
src/com/interview/binarysearch/NumberOfPairWithXPowerYGreaterThanYPowerX.java