This solution is based on the idea of mapping. So, at first, I created a map that the key-value pairs type are Integer, Integer. Then I traverse through the array and check if the map contains the ...