substring search !!

getting WA …help me out guys !! pls !!
question :
my code :

try this input



answer is 2 but your code is giving 1

1 Like

In the lines #36 and #53, you have written the following statement inside the while loop.

Z[i] = R-L;

According to the algorithm in the link provided, this should be outside the while loop. After this change your code gives correct output for the input given by @hruday968

1 Like

i got 2 on my compiler !!

1 Like

i got 1 on hackerearth compiler

1 Like

tqq bro @c_utkarsh got AC !!

1 Like