why in Z algorithm substring length is bound-1? please,explain this anyone.
Z[k] would be longest substring starting at k which is also prefix of the string. Now R-i + 1 gives the length of remaining characters in the Z box. Since we copy the value of Z[k] to optimize the calculation of Z values we need to check whether these values are inside the boundary of the Z box
Why not we calculate the remaining part including k index?K index is in the substring,so why skip this index?