Reg :- Minimum window string

Sir , The code wont work maybe for this test case

string str= “eafbcgefg”;
string pattern=“efg”;

output=
“efg”

Hello @somilgupta4 , :smile:
which code won’t work? is it of prateek bhaiya or is it about what you have coded ?

string str= “eafbcgefg”;
string pattern=“efg”;

output=
“efg”

prateek bhaiya’s

@somilgupta4, basically it will work for the given strings, suppose

string str= “eafbcgefg”;
string pattern=“efg”;
so, it will give an output : gef
which is the smallest window required from string eafbcgefg
Hope You understood :smile:

ok i will try sir , thank you sir

1 Like

Your Welcome @somilgupta4

sir one more doubt please let me edit it

string str= “eafbcgdefg”;
string pattern=“efg”;

You can ask without editing @somilgupta4 :smile:

string str= “eafbcgdefg”;
string pattern=“efg”;

Now it should give “efg”

Exactly @somilgupta4 you got it :+1: :smile:

let me try on compiler than i ll ask the issue again

You can ask it :smile:

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.

Sir before entering if(count==PL)

the FS would be {e:1 ,a:1 , f:1 ,b:1 ,c:1 , g:1}
this array would make count==PL
but the while loop wont work
it doesnt satisfy any condition given in while loop

Hey @somilgupta4 I lost your question link, can you please ask it again in another post .I will answer it there.