У меня есть массив строк, и я хочу подсчитать, сколько раз одна строка найдена в массиве.
Например:
["Harry Potter and the Order of the Phoenix", "Harry Potter and the Order of the Phoenix", "Harry Potter and the Order of the Phoenix", "Harry Potter and the Order of the Phoenix", "Harry Potter and the Order of the Phoenix", "Harry Potter and the Order of the Phoenix", "Harry Potter and the Order of the Phoenix", "Gone with the Wind", "Gone with the Wind", "Gone with the Wind", "Gone with the Wind",""Shopaholic to the Stars (Shopaholic, #7)"", "The Farm", "The Farm", "Men Explain Things to Me", "The Valley of Fear", " The Fellowship of the Ring", " The Fellowship of the Ring", " The Fellowship of the Ring", " The Fellowship of the Ring", " The Fellowship of the Ring", "Mastering the Art of French Cooking", "Play With Me", "Play With Me", "Play With Me", "The Perfect Play", "The Perfect Play", "The Perfect Play", "Dream a Little Dream", "Natural Born Charmer", "Collected Poems", "The Friend Zone"]
Я хочу вернуть имякнига и сколько раз появляется в массиве.
Например:
- Гарри Поттер и Орден Феникса - 5
- Братство Кольца- 1
и т. Д. *