SUB_PROB problem

Here is the link to problem : SPOJ.com - Problem SUB_PROB

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

Here is the link to my code : SUB_PROB - Replit but somehow it didn’t get accepted i.e. WA!

TIA!