Pull last of Hash function not working

Правка en1, от inception_95, 2017-10-25 19:19:41

After watching this video Algorithms Live! Episode 3 — Rolling Hashes and Bloom Filters, I tried to implement pull character from last by myself. I am using 10^9+7 and 10^9+9 as mods. It's giving correct answer for 10^9+7, but giving some weird values for 10^9+9. Can anyone please help finding the problem?

Code : My code

История

 
 
 
 
Правки
 
 
  Rev. Язык Кто Когда Δ Комментарий
en3 Английский inception_95 2017-10-25 23:00:54 371
en2 Английский inception_95 2017-10-25 20:06:45 49 Tiny change: 'om/2YsOxs)' -> 'om/2YsOxs)\n\nEdit: Did a silly mistake. Found the problem.'
en1 Английский inception_95 2017-10-25 19:19:41 445 Initial revision (published)