|
Even if you understand how my code works, please write it out yourself. My version was intentionally written in very poor style so that you would not use it as I wrote it. Even if you keep the same algorithm, just write it out again so that it's readable and so that you surely understand how it works.
You could also try modifying it to report longer matches as a whole and only reporting them once (as opposed to in decreasing pieces), or also eliminating duplicate matches.
|