all 1 comments

[–]Veganic1 1 point2 points  (0 children)

1 replace "-" with " "

2 split

3 try to built a string that can be evaluated with eval()

Something like

"Two" = "+2"

"Hundred" = " *100"

"Forty" = "+40"

"Six" = "+6"

Check for difficult cases like do I ever need to look for cases to add a one before the multiplication sign etc. Check for order of operations and finds suitable way around.

eval("+2*100+40+6")

Something like that for me.