Dont seem to understand what is wrong with this approach


Can anyone provide some test cases on which this doesn’t give the optimum result?

Hey @BloodyOssan
Your code fails for the test case : abca,ba
Read this https://www.geeksforgeeks.org/find-the-smallest-window-in-a-string-containing-all-characters-of-another-string/

If your doubt is resolved please mark it as closed.