Super Hashing

my thinking:
i got the problem
i can do that for a paticular ‘s’ value i can get the different length ‘l’ in which it can be created
and then after i will run the loop for that particular ‘s’ and count the no of times the required ‘l’
that has been occured and print it.

**my problem is that i cant turn it into code **
**i have seen one simple solution it will be very helpfull if anybody could explain me that how it works **

question: CodeChef: Practical coding for everyone
solution:CodeChef: Practical coding for everyone
@ harshitgupta19
plzz can you explain your solution to me