Business Wire Interview Question

parsing a string, remove a character and the one before