Question is not defined clearly


  • 0
    R

    In the example:

    "232", 8 -> ["23+2", "2+32"]

    So, should this be a collection or permutation?

    "232", 8 -> ["23+2", "2+32", "32+2", 2+23]


  • 0
    G

    Permutations may be involved in it
    But solution of this is
    "232",8--> 23+2 , 2+32


  • 0
    R

    May I know why the solution does not contain 32+2 and 2+23?


  • 0

    None of your expressions are correct, for example 23+2 is 25, not 8.

    Also, you're only allowed to "add operators between the digits", so clearly 32+2 is wrong because you did something else as well.


  • 0
    R

    That is 2 times 3 plus 2 not 23 plus 2. Not sure why "*" can not show.


  • 0
    T

    Because it's markdown... put for spaces in front of your examples so it's readable.


  • 0
    T

    return all possibilities to add binary operators [...] between the digits

    it doesn't say anything about reordering the digits. Btw, it's really easy to test this kind of assumption: use a custom testcase; it returns ["2*3+2","2+3*2"].


Log in to reply
 

Looks like your connection to LeetCode Discuss was lost, please wait while we try to reconnect.