Arithmetic formatter review

I need review of the code that I have written to solve the Arithmetic Formatter Problem. While I was able to solve it successfully, I feel there would be a better way of solving it. It would help me learn better if anyone can review it and share their valuable feedback.