String window - stl challenge

some of the test cases are passed but some of them are giving incorrect answer.
ide: https://ide.codingblocks.com/s/208652

your code does not work for bigger string patterns

refer the below codes