I have just finished the mini linter project challenge and came up with my own solutions for 2/3 of the extra challenges.
- For the overused words, remove it every other time it appears.
- Write a function that finds the word that appears the greatest number of times.
- Replaced overused words with something else.
I figured out a way to solve challenge 1 and 3 using a for loop, some if statements, and the
I didn’t put too much time into thinking about challenge 2 because I plan to move on with the course. But I do find that one a bit harder to solve. I’m sharing my code here incase anyone else is curious to see my solutions, and perhaps someone might have some ideas about challenge 2 that they may want to share.
PS. I didn’t follow challenge 3 to the letter but I liked the idea of replacing every other overused word with a new one, but I could have done a quick copy and paste of my code for
reduceOverused() and modified a few of the if statements slightly to follow challenge 3 more exactly.