Write routine getAllWords that takes as parameter a word and returns a Set containing all the substrings of the word. The substrings do not need to be real words, nor contiguous, but the letters in...


Write routine getAllWords that takes as parameter a word and returns a Set containing all the substrings of the word. The substrings do not need to be real words, nor contiguous, but the letters in the substrings must retain the same order as in the word. For instance, if the word is cabb, words that set returned by getAllWords would be [ "", "b", "bb", "a", "ab", "abb", "c", "cb", "cbb", "ca", "cab", "cabb" ].

Nov 25, 2021
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here