I have the following list of Integers
Now I want to write a method which returns specific number of pairs from the list. So if I give it 5 as argument I will expect it to return the following:
So basically when it reaches the end element and another pair is needed, then it should pair the last element of the list with the first one and continue.
Any ideas how can I implement this?