2-3 test cases failing

i have wriiten the exact same code explained in video in hashing section for Miniumu window substring problem but it is giving wrong answers for cases containing spaces between them