STRING WINDOW - minimum length substring

I know that hashing should be used. but how? how do i approach this problem?
https://hack.codingblocks.com/contests/c/380/1665
Thanks!

Personal pe solve kar diya…
If any further doubt comes in this question then ping me