#3557

Find Maximum Number of Non Intersecting Substrings

expert · 1120 · lc medium +32 · 30.4% accepted · 76 likes · top 8%

Description

Given string word, find the maximum number of non-overlapping substrings, each at least 4 characters long, where the first and last characters are identical.

Return that maximum count.

Code

1
2
3