Given a string S and text P. Output the smallest window in the string S having all characters of the text P. Both the string S and text P contains lowercase english alphabets.
First line of the input contains an integer T, denoting the number of test cases. Then T test case follows. Each test contains 2 lines having a string S and next line contains text P.
Output the smallest window of the string containing all the characters of the text. If such window doesn`t exist or this task can not be done then print -1.
You only need to complete the function smallestWindow that returns smallest window of the string containing all the characters of the text. Else return "-1".
1 <= T <= 100
1 <= S.length, P.length <= 1000
If you have purchased any course from GeeksforGeeks then please ask your doubt on course discussion forum. You will get quick replies from GFG Moderators there.