Creating a censor function



I’m struggling with this one, and don’t really understand the solution.
In the solution, a variable “count” is being used. What is its function? Is it to replace the characters of the word (to be censored) with 0s? And why do we increment it after?


we use count to keep track of what index at the list we are at, if then censoring is required we can use count to update a specific element in the list with asterisks