Help in solving Palindromic Queries from snck15el

I was trying to solve the problem ANKPAL | Palindromic Queries, I have seen the editorial for this problem but editorial doesn’t have enough implementation details for hashing. After that I have looked at couple of solutions, but I couldn’t figure out how hashing is working there.
Can anyone please help me with this?


Can you help me with this?