Find Maximum Number of Non Intersecting Substrings
A prefix DP picks the best number of non-overlapping substrings that are at least four letters long and share their first and last letter.
A prefix DP picks the best number of non-overlapping substrings that are at least four letters long and share their first and last letter.