15.4. StringCoder - Part B¶
Part b. Write the StringCoder method encodeString
. A string is encoded by determining the substrings
in the master string that can be combined to generate the given string. The encoding starts with a string part
that matches the beginning of the word, followed by a string part that matches the beginning of the rest of
the word, and so on. The string parts are returned in an array list in the order in which they appear in word.
The helper method findPart
must be used to choose matching string parts in the master string.
15.4.1. Try and Solve It¶
Complete method encodeString
below.
The code below has a main method for testing your method.
Complete method encodeString
below.
You have attempted of activities on this page