If we have two inputs shown below
String input1 = “qweaty asdfgh qazxsw”;
String input2 = “qas”;
Q1->Is this result correct correct ???
Result = “qweaty as”,“qazxs”;
String input1 = “qweatys adfgh qazxsw”;
String input2 = “qas”;
Q2->Is this result correct correct ???
Result = “qweatys”,“qazxs”;
Q3->Can you also provide any corner cases which have been missed ?