String Query problem- need test cases

i need test cases for link text problem.I wrote code for it…but getting WA.I executed some of my custom test case but could not find any error.

my code link is given below :-
link text

//