Block interview question

Write an escape function for some input strings