Driver program
string1 = " ad " NEW_LINE print " Input ▁ = > ▁ " + string1 +   " NEW_LINE Output = >   " , NEW_LINE print stringFilter ( toList ( string1 ) ) +   " NEW_LINE " NEW_LINE string2 = " acbac " NEW_LINE print " Input ▁ = > ▁ " + string2 +   " NEW_LINE Output = >   " , NEW_LINE print stringFilter ( toList ( string2 ) ) +   " NEW_LINE " NEW_LINE string3 = " aaac " NEW_LINE print " Input ▁ = > ▁ " + string3 +   " NEW_LINE Output = >   " , NEW_LINE print stringFilter ( toList ( string3 ) ) +   " NEW_LINE " NEW_LINE string4 = " react " NEW_LINE print " Input ▁ = > ▁ " + string4 +   " NEW_LINE Output = >   " , NEW_LINE print stringFilter ( toList ( string4 ) ) +   " NEW_LINE " NEW_LINE string5 = " aa " NEW_LINE print " Input ▁ = > ▁ " + string5 +   " NEW_LINE Output = >   " , NEW_LINE print stringFilter ( toList ( string5 ) ) +   " NEW_LINE " NEW_LINE string6 = " ababaac " NEW_LINE print " Input ▁ = > ▁ " + string6 +   " NEW_LINE Output = >   " , NEW_LINE print stringFilter ( toList ( string6 ) ) +   " NEW_LINE " NEW_LINE string7 = " abc " NEW_LINE print " Input ▁ = > ▁ " + string7 +   " NEW_LINE Output = >   " , NEW_LINE print stringFilter ( toList ( string7 ) ) +   " NEW_LINE " NEW_LINE