Question: String Challenge Have the function stringchallenge (stz) take the str parameter being passed and return the first word with the greatest number of repeated letters.

String Challenge Have the function stringchallenge (stz) take the str parameter being passed and return the first word with the greatest number of repeated letters. For example: "Today, is the greatest day ever!" should return greatest because it has 2 e's (and 2 t's) and it comes before ever which also has 2e 's. If there are no words with repeating letters return - 1. Words will be separated by spaces. Examples Input: "Hello apple pie" Output: Hello Input: "No words" Output: 1
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
