@@ -0,0 +1,1310 @@
+package array;%0A%0Aimport java.util.ArrayList;%0Aimport java.util.HashMap;%0Aimport java.util.List;%0Aimport java.util.Map;%0Aimport java.util.Map.Entry;%0A%0Apublic class FindAllPairsABCD %7B%0A%0A  public List%3CInteger%5B%5D%3E findAllPairs(int%5B%5D arr) %7B%0A    List%3CInteger%5B%5D%3E resultList = new ArrayList%3CInteger%5B%5D%3E();%0A    Map%3CInteger, List%3CInteger%5B%5D%3E%3E productMap = new HashMap%3CInteger, List%3CInteger%5B%5D%3E%3E();%0A%0A    for (int i = 0; i %3C arr.length; i++) %7B%0A      for (int j = i + 1; j %3C arr.length; j++) %7B%0A        int product = arr%5Bi%5D * arr%5Bj%5D;%0A        List%3CInteger%5B%5D%3E tupleList = new ArrayList%3CInteger%5B%5D%3E();%0A        if (productMap.containsKey(product)) %7B%0A          tupleList = productMap.get(product);%0A        %7D%0A%0A        tupleList.add(new Integer%5B%5D %7B arr%5Bi%5D, arr%5Bj%5D %7D);%0A        productMap.putIfAbsent(product, tupleList);%0A      %7D%0A    %7D%0A%0A    for (Entry%3CInteger, List%3CInteger%5B%5D%3E%3E entry : productMap.entrySet()) %7B%0A      if (entry.getValue().size() %3E 1) %7B%0A        resultList.addAll(entry.getValue());%0A      %7D%0A    %7D%0A%0A    return resultList;%0A  %7D%0A%0A  public static void main(String%5B%5D args) %7B%0A    FindAllPairsABCD findAllPairsABCD = new FindAllPairsABCD();%0A    List%3CInteger%5B%5D%3E allPairs = findAllPairsABCD.findAllPairs(new int%5B%5D %7B 3, 4, 7, 1, 2, 9, 8 %7D);%0A    for (Integer%5B%5D pair : allPairs) %7B%0A      System.out.println(pair%5B0%5D + %22,%22 + pair%5B1%5D);%0A    %7D%0A  %7D%0A%7D%0A

Add solution for FindAllPairsABCD