Skip to main content
1 of 4

Python 3.5, 82

i=input
a,b=[*i()],[*i()]
print(*[y==b[0]and b.pop(0)or"#"for y in a if b],sep="")

Try it here