Replace them all

please give the solution of replace them all question from hacker blocks