String window using hashing


error?

Hello @Vibhuti0206

You misunderstood the problem statement.
The problem statement says that you need to find the minimum length sub-string of string1 that has all the characters of string2 (It does NOT say that their frequency should also be the same).

Example
abca
aabb

output here would be “ab” because this string has all the characters from string2

Also you should take input like I have done in below code, because if you input a string using cin, it will take the input only until a space is encountered and NOT the complete line.

If you need any help, just leave a reply to this thread and I will get back to you.