Need testcases to check error in longest common substring problem using hashing + binary search

I was solving this problem link text
and my solution is link text

but even after multiplt attempts , I am getting WA . Any idea what I might be missing ??

Found solution using double hashing
solution

//