It seems like you already figured out how to get the Characters from the ArrayList and compare them to see if they are the same. Now all you need to do is write a for loop that prints from 1 . . n where n is the number of elements in your ArrayList. But once you get to the index where the Characters are that you were supposed to compare, you need an if statement to decide whether to print out the Character itself or whether to print out the index.
P.S. Masijade wasn't being rude, just straightforward. You seem to have the basic idea down, so if you know how to use a for loop and an if statement, you should be able to do this.