Substring-dif

Substring-diff using an optimized solution compared to O(n^3) as
originally used)