I have the following scenario: I have a variable with a text inside. I separate this text by words inside an array , with this I need to validate how many times each word appears in the text. I managed to do it, but there is another detail, I need to run the entire list without going through a word that I have already got the count.
Ex: "In a nest of mafagafos there are seven mafagafinhos." When the mafagafa gafa, they gafam the seven mafagafinhos. "
In this case I can not pass the code without repeating the "mafagafinhos". What do I do?