Add binary operators

Правка en1, от aakarshmadhavan, 2018-07-20 16:12:48

Given a string that contains only digits 0-9 and a target value, return all possibilities to add binary operators (not unary) +, -, or * between the digits so they evaluate to the target value.

The trouble here is how to separate the * and the other operators so I can have a "cumulative" sum. Because

1+3*2 is based on 3*2 and not 1+...

Please help me out. Thanks

История

 
 
 
 
Правки
 
 
  Rev. Язык Кто Когда Δ Комментарий
en1 Английский aakarshmadhavan 2018-07-20 16:12:48 481 Initial revision (published)