fork download
  1. def f(x,y,s=''):
  2. for c in x:g=y[:1]==c;s+=c*-~g;y=y[g:]
  3. print s
  4.  
  5. f("lizard","iard")
  6. f("onomatopoeia", "ooaoo")
  7. f("onomatopoeia","oao")
Success #stdin #stdout 0.01s 7736KB
stdin
Standard input is empty
stdout
liizaarrdd
oonoomaatoopooeia
oonomaatoopoeia