i'm currently working on a small project/game that involves guessing words that end in a certain character. in order to win, the player must beat the computer in guessing 3 words that all end in the same letter. For instance, if i choose cookies, snickers, and libraries, i would win because all 3 end in the letter "s."
in my game, each word is processed as it is played and the last character is added to an array list. What is the most efficient method of checking and counting if this letter already exists in the array list? I saw some things on removing duplicates and such, but in my case, I need to be able to identify duplicates and make sure that 3 of the same character exist inside the array list.