Can you elaborate? I did try using a large base (109 ,113, etc) and the test will still pass but I couldn’t figure out why overflow will not impact correctness of the algorithm.
I would think when hash function is rolling, both lines below might overflow but why t_hash would still be a correct one when matching is found?
t_hash -= t[i - size(s) ] * power_s;
t_hash = t_hash * kBase + t[i];