Given an integer array, I want to print out all the distinct pairs of halves of the array. [2,1] [3,2] and [3,2] [2,1] can be considered distinct.
I'm sure there's a brute force way, but I want something more efficient and I can't really figure it out.
You can encapsulate the ArrayList class, to provide a contains method.
Here is an example.
Output