Longest common substring
Find shortest and longest path