I'm baffled on the logic of programming this. I'm sure it's extremely simple.
So, I have an ArrayList<String> with values A, B, C, D, E, F, G. Indexed in that order.
I would like to randomly select a unique letter for each but have no duplication.
The output would look similar to this.
A:B
B:A
C:E
D:F
E:C
F:D
I’ve tried shuffling the ArrayList then moving the index by two, but couldn’t think of a way to prevent duplication, and also randomly selecting indexes then pairing them up but this only works with even numbers.