Regarding the time complexity of string window problem

I didn’t understand the time complexity of the code.

Hello @Senjuti256 what point you have not understood?

How the time complexity came (m+n) log 256

@Senjuti256 this is because in all there are 256 characters and first we have to hash the string 1 of length n and we have to hash the string 2 of length m.
this is the most time taking step in this algo when we are talking about the average case.

How much time does hashing takes?

see when we have to hash a string of length n say the string is aabbcd then we have to iterate every alphabghet in the string and in this way the hashing will take place in the time equal to the length of the string:

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.

@tarunluthra
@rhlbhrdwj3