Write a method called split that takes a set of strings as a parameter and that returns the result of splitting the strings into different sets based on the length of the strings. In particular, your method should return a map whose keys are integers and whose values are sets of strings of that length. For example, if a variable called words contains the following set of strings:
[to, be, or, not, that, is, the, question]
then the call split(words) should return a map whose values are sets of strings of equal length and whose keys are the string lengths:
{2=[be, is, or, to], 3=[not, the], 4=[that], 8=[question]}
Notice that strings of length 2 like "be" and "is" appear in a set whose key is 2. If the set had instead stored these strings:
[four, score, and, seven, years, ago, our, fathers, brought, forth]
Then the method would return this map:
{3=[ago, and, our], 4=[four], 5=[forth, score, seven, years], 7=[brought, fathers]}