add header
dynamic programming for distances between sub-strings
sol of q072