Top functions reviewed by kandi - BETA
I have a question that asked me to:
Clean the following text and find the most frequent word: "
I used regEx to clean the string like this:...
ANSWERAnswered 2022-Mar-28 at 09:04
I wouldn't change the spaces to "1". Instead use a regex that will not remove spaces while cleaning.
Then you can call
match on the cleaned string, and use
reduce to start counting words and maintain a reference to the most frequent one:
No vulnerabilities reported
Reuse Trending Solutions
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page