Ramp interview question

write a text processing algorithm