Find longest common string between strA and strB
for each char in strA, we find its location in strB.
This is a 2D array, strA at row -1, strB at colum -1, e.g. eab
We use colum major, with subarray being one colum.
See findCommonStrUtil. We could initialize all to 0 first, or initialize along the way.
For each common char, e.g. b:b, it number means the longest common ending at b.
it's its upper-left + 1, here is a:a + 1 = 2
e.g.
a b c
e 0 0 0
a 1 0 0
b 0 2 0
Notes: suffix tree can also do it, but overkill.
Download: http://riowing.net/p/wp/string.cpp