I am making a slotmachine. And working on the part were I tell if the player has won. So, now I have a list (List<String> winLineSymbols) that contrain 5 strings. For example: 0 - Bell 1 - Seven 2 - Cherry 3 - Cherry 4 - Cherry Problem one: How can I compare all of them to see how many is in a row? Problem two: The position is also important. Take the example above... Even though the results show 3x Cherry, they were on the last 3 reels of the slotmachine....hence not giving the player a win. If it was: 0 - Cherry 1 - Cherry 2 - Cherry 3 - Seven 4 - Bell on the otherhand, the player would have 3 in a row, giving him a small win. I need to check for 3, 4 and 5 in a row.