Ulf Dittmer wrote:I'd start by figuring out why the simple cases don't work, e.g.
"a" and "ab" --> 0
"a" and "ba" --> 2
when both should be 1.
i see that it checks the last char in the first time the recursion is called and also in the second time.
i have to check the leftest char so i changed c to be c = s2.charAt(0) it works for the cases you wrote but not for "a" and "aaa"