We have a function names. When the function is called, a list namesList: List<String> is passed through the parameters. Implement counting the number of names in the input list.
Write the result of the calculation to the nameCount list in the following format: The name Vasya is repeated 2 times.
For example, the input list contains the following names: "Vasya", "Olga", "Vasya", "Dima", "Masha", "Vasa", "Olga".
As a result of the function, the nameCount list will have the following contents:
"The name Vasya is repeated 2 times"
"The name Olga is repeated 2 times"
"The name Dima is repeated 1 times"
"The name Masha is repeated 1 times"
"The name Vasa is repeated 1 times"
You can solve this problem using only lists, but if you want to use Map, you can read more in the topics: Map collection and MutableMap.