SUB_PROB problem

Here is the link to problem : http://www.spoj.com/problems/SUB_PROB/

Can anyone please provide me the code to solve the problem using hashing function?

Here is the link to my code : https://repl.it/@NikhilAgrawal/SUBPROB but somehow it didn’t get accepted i.e. WA!

TIA!