def f(x,y,s=''): for c in x:g=y[:1]==c;s+=c*-~g;y=y[g:] print s f("lizard","iard")f("onomatopoeia", "ooaoo")f("onomatopoeia","oao")
Standard input is empty
liizaarrdd oonoomaatoopooeia oonomaatoopoeia
The brand new service which powers Ideone!
Widget for compiling and running the source code in a web browser!