Pull last of Hash function not working

Revision en3, by inception_95, 2017-10-25 23:00:54

After watching this video Algorithms Live! Episode 3 — Rolling Hashes and Bloom Filters, I tried to implement pull character from last by myself and applying it on this problem here:

Problem: 1423. String Tale

Code : My code

Is my implementation wrong? if so, what is wrong in this? or can anyone give a code that works like the same principle as the video and works perfectly?

Thanks in advance.

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en3 English inception_95 2017-10-25 23:00:54 371
en2 English 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 English inception_95 2017-10-25 19:19:41 445 Initial revision (published)