Possible combinations of the digits 1-9 using only 4 operators inclusive of two addition and two subtractions symbols

Question:

This problem has been haunting me for the last 24 hours, and I’ve been messing around with my amateur python coding skills to no avail.

The problem in question is this:

You are given the numbers 1 to 9 (inclusive). Inbetween each number is a space where you are able to insert a mathmatical operator. You are given 2 addition symbols and 2 subtraction symbols, and you have to use them all. If there is no operator between 2 numbers, for example, 1 2, then when inputted into the final equation would become 12. This would be the same with 3 numbers e.g. 1 2 3, which would become 123.

You cannot move or rotate the numbers nor can you rotate the symbols around (e.g. + -> x), but you can put the symbols in any slot between the numbers you desire. The idea here is to create a script whereby you are able to calculate a specific number summative of the numbers given.

I will list some examples below to better portray what the question actually wants you to create:

123+45-67+8-9

12-34+56-7+89

1-234+56-78+9

I would appreciate any ideas of how to script this to find all available permutations of making a certain number. There is no certain output number in particular, just something versatile to cover any number (in reason) you wanted to output.

Asked By: Cameron Ashton

||

Answers:

There’s not many combinations to try (3^8=6561), and you can just go through all possibilities of ‘+’, ‘-‘ and the empty string between each digit and discard the ones that don’t have exactly 2 plusses and minuses. Then you can find out what the result is using eval.

For example:

import itertools

for x in itertools.product(['+', '-', ''], repeat=8):
    if x.count('+') != 2 or x.count('-') != 2:
        continue
    e = '%s'.join('123456789') % x
    print(e, '=', eval(e))
Answered By: Paul Hankin

I will not code this out for you, but only give some hints of how you can approach this:

For getting the permutations of the signs you can use itertools’ permutations methos, so something like this: permutations = itertools.permutations(['-', '-', '+', '+']). There will be some duplicates in there, so you can filter those duplicates by wrapping that in a set.

This will be your outermost loop, so something like:

for sign_permutation in set(itertools.permutations(['-', '-', '+', '+']): 
   create_string_with_permutations(sign_permutation)

Then you have to figure out a way to place those signs in your string.
For the first you know that the earliest index, where you can place it, is 1. Then the first digit is 1.
Then you have to increase your index by at least 2 to being able to place the next symbol and so on. So you continue for all symbols.

On each loop you will have to figure out, how far you can go. Lets look at the first sign. The shortest string with signs you can place at the end is "6-7+8+9".
This are 4 numbers and so you have to place it before that. Your highest index should be 5 I think. For the second iteration you do the same. The longest possible remainder is "7+8-9" so the upper end is 6 and so on.

So to put it together in some kind if pseudocode, it would look like this:

all_solutions = list()
for sign_perm in permutations:
   for first_index in range(1, 6):
       for second_index in range(first_index + 1, 7):
           for third_index in range(second_index + 1, 8):
               for fourth_index in range(third_index + 1, 9):
                   s = "123456789"
                   s = s.insert(sign_perm[3], fourth_index)
                   s = s.insert(sign_perm[2], third_index)
                   s = s.insert(sign_perm[1], second_index)
                   s = s.insert(sign_perm[0], first_index)
                   all_solutions.append(s)

Take this end indices there a bit with a grain of salt. I’m not completely sure whether they are okay. Possibly you’ll have to adjust that a bit.

Let me know, if something is not so clear.

EDIT:

So I actually did implement it in my way, so I can also provide you the solution:

from itertools import permutations
for perm in set(permutations(['-', '-', '+', '+'])):
    for first in range(1, 6):
        for second in range(first + 1, 7):
            for third in range(second + 1, 8):
                for fourth in range(third + 1, 9):
                    s = "123456789"
                    s = s[:fourth] + perm[3] + s[fourth:]
                    s = s[:third] + perm[2] + s[third:]
                    s = s[:second] + perm[1] + s[second:]
                    s = s[:first] + perm[0] + s[first:]
                    print(s)
Answered By: Christian

You have 9 digits and 8 "slots" between those. 8 slots are 2 plus signs, 2 minus signs and 4 "empty" slots:

slots = ['+'] * 2 + ['-' * 2] + ['' * 4]

Then use itertools.combinations to get all the permutations of slots, construct the expressions inserting operands between digits, and eval them.

Answered By: Klas Š.

You could utilize itertools:

from itertools import combinations, permutations

nums = '123456789'
printed_equations = set()
for a, b, c, d in combinations(range(1, len(nums)), r=4):
    n1, n2, n3, n4, n5 = nums[:a], nums[a:b], nums[b:c], nums[c:d], nums[d:]
    for s1, s2, s3, s4 in permutations(['+', '+', '-', '-']):
        equation = f'{n1} {s1} {n2} {s2} {n3} {s3} {n4} {s4} {n5}'
        if equation not in printed_equations:
            print(f'{equation} = {eval(equation)}')
            printed_equations.add(equation)

Output:

1 + 2 + 3 - 4 - 56789 = -56787
1 + 2 - 3 + 4 - 56789 = -56785
1 + 2 - 3 - 4 + 56789 = 56785
1 - 2 + 3 + 4 - 56789 = -56783
1 - 2 + 3 - 4 + 56789 = 56787
1 - 2 - 3 + 4 + 56789 = 56789
1 + 2 + 3 - 45 - 6789 = -6828
1 + 2 - 3 + 45 - 6789 = -6744
1 + 2 - 3 - 45 + 6789 = 6744
1 - 2 + 3 + 45 - 6789 = -6742
1 - 2 + 3 - 45 + 6789 = 6746
1 - 2 - 3 + 45 + 6789 = 6830
1 + 2 + 3 - 456 - 789 = -1239
1 + 2 - 3 + 456 - 789 = -333
1 + 2 - 3 - 456 + 789 = 333
1 - 2 + 3 + 456 - 789 = -331
1 - 2 + 3 - 456 + 789 = 335
1 - 2 - 3 + 456 + 789 = 1241
1 + 2 + 3 - 4567 - 89 = -4650
1 + 2 - 3 + 4567 - 89 = 4478
1 + 2 - 3 - 4567 + 89 = -4478
1 - 2 + 3 + 4567 - 89 = 4480
1 - 2 + 3 - 4567 + 89 = -4476
1 - 2 - 3 + 4567 + 89 = 4652
1 + 2 + 3 - 45678 - 9 = -45681
1 + 2 - 3 + 45678 - 9 = 45669
1 + 2 - 3 - 45678 + 9 = -45669
1 - 2 + 3 + 45678 - 9 = 45671
1 - 2 + 3 - 45678 + 9 = -45667
1 - 2 - 3 + 45678 + 9 = 45683
1 + 2 + 34 - 5 - 6789 = -6757
1 + 2 - 34 + 5 - 6789 = -6815
1 + 2 - 34 - 5 + 6789 = 6753
1 - 2 + 34 + 5 - 6789 = -6751
1 - 2 + 34 - 5 + 6789 = 6817
1 - 2 - 34 + 5 + 6789 = 6759
1 + 2 + 34 - 56 - 789 = -808
1 + 2 - 34 + 56 - 789 = -764
1 + 2 - 34 - 56 + 789 = 702
1 - 2 + 34 + 56 - 789 = -700
1 - 2 + 34 - 56 + 789 = 766
1 - 2 - 34 + 56 + 789 = 810
1 + 2 + 34 - 567 - 89 = -619
1 + 2 - 34 + 567 - 89 = 447
1 + 2 - 34 - 567 + 89 = -509
1 - 2 + 34 + 567 - 89 = 511
1 - 2 + 34 - 567 + 89 = -445
1 - 2 - 34 + 567 + 89 = 621
1 + 2 + 34 - 5678 - 9 = -5650
1 + 2 - 34 + 5678 - 9 = 5638
1 + 2 - 34 - 5678 + 9 = -5700
1 - 2 + 34 + 5678 - 9 = 5702
1 - 2 + 34 - 5678 + 9 = -5636
1 - 2 - 34 + 5678 + 9 = 5652
1 + 2 + 345 - 6 - 789 = -447
1 + 2 - 345 + 6 - 789 = -1125
1 + 2 - 345 - 6 + 789 = 441
1 - 2 + 345 + 6 - 789 = -439
1 - 2 + 345 - 6 + 789 = 1127
1 - 2 - 345 + 6 + 789 = 449
1 + 2 + 345 - 67 - 89 = 192
1 + 2 - 345 + 67 - 89 = -364
1 + 2 - 345 - 67 + 89 = -320
1 - 2 + 345 + 67 - 89 = 322
1 - 2 + 345 - 67 + 89 = 366
1 - 2 - 345 + 67 + 89 = -190
1 + 2 + 345 - 678 - 9 = -339
1 + 2 - 345 + 678 - 9 = 327
1 + 2 - 345 - 678 + 9 = -1011
1 - 2 + 345 + 678 - 9 = 1013
1 - 2 + 345 - 678 + 9 = -325
1 - 2 - 345 + 678 + 9 = 341
1 + 2 + 3456 - 7 - 89 = 3363
1 + 2 - 3456 + 7 - 89 = -3535
1 + 2 - 3456 - 7 + 89 = -3371
1 - 2 + 3456 + 7 - 89 = 3373
1 - 2 + 3456 - 7 + 89 = 3537
1 - 2 - 3456 + 7 + 89 = -3361
1 + 2 + 3456 - 78 - 9 = 3372
1 + 2 - 3456 + 78 - 9 = -3384
1 + 2 - 3456 - 78 + 9 = -3522
1 - 2 + 3456 + 78 - 9 = 3524
1 - 2 + 3456 - 78 + 9 = 3386
1 - 2 - 3456 + 78 + 9 = -3370
1 + 2 + 34567 - 8 - 9 = 34553
1 + 2 - 34567 + 8 - 9 = -34565
1 + 2 - 34567 - 8 + 9 = -34563
1 - 2 + 34567 + 8 - 9 = 34565
1 - 2 + 34567 - 8 + 9 = 34567
1 - 2 - 34567 + 8 + 9 = -34551
1 + 23 + 4 - 5 - 6789 = -6766
1 + 23 - 4 + 5 - 6789 = -6764
1 + 23 - 4 - 5 + 6789 = 6804
1 - 23 + 4 + 5 - 6789 = -6802
1 - 23 + 4 - 5 + 6789 = 6766
1 - 23 - 4 + 5 + 6789 = 6768
1 + 23 + 4 - 56 - 789 = -817
1 + 23 - 4 + 56 - 789 = -713
1 + 23 - 4 - 56 + 789 = 753
1 - 23 + 4 + 56 - 789 = -751
1 - 23 + 4 - 56 + 789 = 715
1 - 23 - 4 + 56 + 789 = 819
1 + 23 + 4 - 567 - 89 = -628
1 + 23 - 4 + 567 - 89 = 498
1 + 23 - 4 - 567 + 89 = -458
1 - 23 + 4 + 567 - 89 = 460
1 - 23 + 4 - 567 + 89 = -496
1 - 23 - 4 + 567 + 89 = 630
1 + 23 + 4 - 5678 - 9 = -5659
1 + 23 - 4 + 5678 - 9 = 5689
1 + 23 - 4 - 5678 + 9 = -5649
1 - 23 + 4 + 5678 - 9 = 5651
1 - 23 + 4 - 5678 + 9 = -5687
1 - 23 - 4 + 5678 + 9 = 5661
1 + 23 + 45 - 6 - 789 = -726
1 + 23 - 45 + 6 - 789 = -804
1 + 23 - 45 - 6 + 789 = 762
1 - 23 + 45 + 6 - 789 = -760
1 - 23 + 45 - 6 + 789 = 806
1 - 23 - 45 + 6 + 789 = 728
1 + 23 + 45 - 67 - 89 = -87
1 + 23 - 45 + 67 - 89 = -43
1 + 23 - 45 - 67 + 89 = 1
1 - 23 + 45 + 67 - 89 = 1
1 - 23 + 45 - 67 + 89 = 45
1 - 23 - 45 + 67 + 89 = 89
1 + 23 + 45 - 678 - 9 = -618
1 + 23 - 45 + 678 - 9 = 648
1 + 23 - 45 - 678 + 9 = -690
1 - 23 + 45 + 678 - 9 = 692
1 - 23 + 45 - 678 + 9 = -646
1 - 23 - 45 + 678 + 9 = 620
1 + 23 + 456 - 7 - 89 = 384
1 + 23 - 456 + 7 - 89 = -514
1 + 23 - 456 - 7 + 89 = -350
1 - 23 + 456 + 7 - 89 = 352
1 - 23 + 456 - 7 + 89 = 516
1 - 23 - 456 + 7 + 89 = -382
1 + 23 + 456 - 78 - 9 = 393
1 + 23 - 456 + 78 - 9 = -363
1 + 23 - 456 - 78 + 9 = -501
1 - 23 + 456 + 78 - 9 = 503
1 - 23 + 456 - 78 + 9 = 365
1 - 23 - 456 + 78 + 9 = -391
1 + 23 + 4567 - 8 - 9 = 4574
1 + 23 - 4567 + 8 - 9 = -4544
1 + 23 - 4567 - 8 + 9 = -4542
1 - 23 + 4567 + 8 - 9 = 4544
1 - 23 + 4567 - 8 + 9 = 4546
1 - 23 - 4567 + 8 + 9 = -4572
1 + 234 + 5 - 6 - 789 = -555
1 + 234 - 5 + 6 - 789 = -553
1 + 234 - 5 - 6 + 789 = 1013
1 - 234 + 5 + 6 - 789 = -1011
1 - 234 + 5 - 6 + 789 = 555
1 - 234 - 5 + 6 + 789 = 557
1 + 234 + 5 - 67 - 89 = 84
1 + 234 - 5 + 67 - 89 = 208
1 + 234 - 5 - 67 + 89 = 252
1 - 234 + 5 + 67 - 89 = -250
1 - 234 + 5 - 67 + 89 = -206
1 - 234 - 5 + 67 + 89 = -82
1 + 234 + 5 - 678 - 9 = -447
1 + 234 - 5 + 678 - 9 = 899
1 + 234 - 5 - 678 + 9 = -439
1 - 234 + 5 + 678 - 9 = 441
1 - 234 + 5 - 678 + 9 = -897
1 - 234 - 5 + 678 + 9 = 449
1 + 234 + 56 - 7 - 89 = 195
1 + 234 - 56 + 7 - 89 = 97
1 + 234 - 56 - 7 + 89 = 261
1 - 234 + 56 + 7 - 89 = -259
1 - 234 + 56 - 7 + 89 = -95
1 - 234 - 56 + 7 + 89 = -193
1 + 234 + 56 - 78 - 9 = 204
1 + 234 - 56 + 78 - 9 = 248
1 + 234 - 56 - 78 + 9 = 110
1 - 234 + 56 + 78 - 9 = -108
1 - 234 + 56 - 78 + 9 = -246
1 - 234 - 56 + 78 + 9 = -202
1 + 234 + 567 - 8 - 9 = 785
1 + 234 - 567 + 8 - 9 = -333
1 + 234 - 567 - 8 + 9 = -331
1 - 234 + 567 + 8 - 9 = 333
1 - 234 + 567 - 8 + 9 = 335
1 - 234 - 567 + 8 + 9 = -783
1 + 2345 + 6 - 7 - 89 = 2256
1 + 2345 - 6 + 7 - 89 = 2258
1 + 2345 - 6 - 7 + 89 = 2422
1 - 2345 + 6 + 7 - 89 = -2420
1 - 2345 + 6 - 7 + 89 = -2256
1 - 2345 - 6 + 7 + 89 = -2254
1 + 2345 + 6 - 78 - 9 = 2265
1 + 2345 - 6 + 78 - 9 = 2409
1 + 2345 - 6 - 78 + 9 = 2271
1 - 2345 + 6 + 78 - 9 = -2269
1 - 2345 + 6 - 78 + 9 = -2407
1 - 2345 - 6 + 78 + 9 = -2263
1 + 2345 + 67 - 8 - 9 = 2396
1 + 2345 - 67 + 8 - 9 = 2278
1 + 2345 - 67 - 8 + 9 = 2280
1 - 2345 + 67 + 8 - 9 = -2278
1 - 2345 + 67 - 8 + 9 = -2276
1 - 2345 - 67 + 8 + 9 = -2394
1 + 23456 + 7 - 8 - 9 = 23447
1 + 23456 - 7 + 8 - 9 = 23449
1 + 23456 - 7 - 8 + 9 = 23451
1 - 23456 + 7 + 8 - 9 = -23449
1 - 23456 + 7 - 8 + 9 = -23447
1 - 23456 - 7 + 8 + 9 = -23445
12 + 3 + 4 - 5 - 6789 = -6775
12 + 3 - 4 + 5 - 6789 = -6773
12 + 3 - 4 - 5 + 6789 = 6795
12 - 3 + 4 + 5 - 6789 = -6771
12 - 3 + 4 - 5 + 6789 = 6797
12 - 3 - 4 + 5 + 6789 = 6799
12 + 3 + 4 - 56 - 789 = -826
12 + 3 - 4 + 56 - 789 = -722
12 + 3 - 4 - 56 + 789 = 744
12 - 3 + 4 + 56 - 789 = -720
12 - 3 + 4 - 56 + 789 = 746
12 - 3 - 4 + 56 + 789 = 850
12 + 3 + 4 - 567 - 89 = -637
12 + 3 - 4 + 567 - 89 = 489
12 + 3 - 4 - 567 + 89 = -467
12 - 3 + 4 + 567 - 89 = 491
12 - 3 + 4 - 567 + 89 = -465
12 - 3 - 4 + 567 + 89 = 661
12 + 3 + 4 - 5678 - 9 = -5668
12 + 3 - 4 + 5678 - 9 = 5680
12 + 3 - 4 - 5678 + 9 = -5658
12 - 3 + 4 + 5678 - 9 = 5682
12 - 3 + 4 - 5678 + 9 = -5656
12 - 3 - 4 + 5678 + 9 = 5692
12 + 3 + 45 - 6 - 789 = -735
12 + 3 - 45 + 6 - 789 = -813
12 + 3 - 45 - 6 + 789 = 753
12 - 3 + 45 + 6 - 789 = -729
12 - 3 + 45 - 6 + 789 = 837
12 - 3 - 45 + 6 + 789 = 759
12 + 3 + 45 - 67 - 89 = -96
12 + 3 - 45 + 67 - 89 = -52
12 + 3 - 45 - 67 + 89 = -8
12 - 3 + 45 + 67 - 89 = 32
12 - 3 + 45 - 67 + 89 = 76
12 - 3 - 45 + 67 + 89 = 120
12 + 3 + 45 - 678 - 9 = -627
12 + 3 - 45 + 678 - 9 = 639
12 + 3 - 45 - 678 + 9 = -699
12 - 3 + 45 + 678 - 9 = 723
12 - 3 + 45 - 678 + 9 = -615
12 - 3 - 45 + 678 + 9 = 651
12 + 3 + 456 - 7 - 89 = 375
12 + 3 - 456 + 7 - 89 = -523
12 + 3 - 456 - 7 + 89 = -359
12 - 3 + 456 + 7 - 89 = 383
12 - 3 + 456 - 7 + 89 = 547
12 - 3 - 456 + 7 + 89 = -351
12 + 3 + 456 - 78 - 9 = 384
12 + 3 - 456 + 78 - 9 = -372
12 + 3 - 456 - 78 + 9 = -510
12 - 3 + 456 + 78 - 9 = 534
12 - 3 + 456 - 78 + 9 = 396
12 - 3 - 456 + 78 + 9 = -360
12 + 3 + 4567 - 8 - 9 = 4565
12 + 3 - 4567 + 8 - 9 = -4553
12 + 3 - 4567 - 8 + 9 = -4551
12 - 3 + 4567 + 8 - 9 = 4575
12 - 3 + 4567 - 8 + 9 = 4577
12 - 3 - 4567 + 8 + 9 = -4541
12 + 34 + 5 - 6 - 789 = -744
12 + 34 - 5 + 6 - 789 = -742
12 + 34 - 5 - 6 + 789 = 824
12 - 34 + 5 + 6 - 789 = -800
12 - 34 + 5 - 6 + 789 = 766
12 - 34 - 5 + 6 + 789 = 768
12 + 34 + 5 - 67 - 89 = -105
12 + 34 - 5 + 67 - 89 = 19
12 + 34 - 5 - 67 + 89 = 63
12 - 34 + 5 + 67 - 89 = -39
12 - 34 + 5 - 67 + 89 = 5
12 - 34 - 5 + 67 + 89 = 129
12 + 34 + 5 - 678 - 9 = -636
12 + 34 - 5 + 678 - 9 = 710
12 + 34 - 5 - 678 + 9 = -628
12 - 34 + 5 + 678 - 9 = 652
12 - 34 + 5 - 678 + 9 = -686
12 - 34 - 5 + 678 + 9 = 660
12 + 34 + 56 - 7 - 89 = 6
12 + 34 - 56 + 7 - 89 = -92
12 + 34 - 56 - 7 + 89 = 72
12 - 34 + 56 + 7 - 89 = -48
12 - 34 + 56 - 7 + 89 = 116
12 - 34 - 56 + 7 + 89 = 18
12 + 34 + 56 - 78 - 9 = 15
12 + 34 - 56 + 78 - 9 = 59
12 + 34 - 56 - 78 + 9 = -79
12 - 34 + 56 + 78 - 9 = 103
12 - 34 + 56 - 78 + 9 = -35
12 - 34 - 56 + 78 + 9 = 9
12 + 34 + 567 - 8 - 9 = 596
12 + 34 - 567 + 8 - 9 = -522
12 + 34 - 567 - 8 + 9 = -520
12 - 34 + 567 + 8 - 9 = 544
12 - 34 + 567 - 8 + 9 = 546
12 - 34 - 567 + 8 + 9 = -572
12 + 345 + 6 - 7 - 89 = 267
12 + 345 - 6 + 7 - 89 = 269
12 + 345 - 6 - 7 + 89 = 433
12 - 345 + 6 + 7 - 89 = -409
12 - 345 + 6 - 7 + 89 = -245
12 - 345 - 6 + 7 + 89 = -243
12 + 345 + 6 - 78 - 9 = 276
12 + 345 - 6 + 78 - 9 = 420
12 + 345 - 6 - 78 + 9 = 282
12 - 345 + 6 + 78 - 9 = -258
12 - 345 + 6 - 78 + 9 = -396
12 - 345 - 6 + 78 + 9 = -252
12 + 345 + 67 - 8 - 9 = 407
12 + 345 - 67 + 8 - 9 = 289
12 + 345 - 67 - 8 + 9 = 291
12 - 345 + 67 + 8 - 9 = -267
12 - 345 + 67 - 8 + 9 = -265
12 - 345 - 67 + 8 + 9 = -383
12 + 3456 + 7 - 8 - 9 = 3458
12 + 3456 - 7 + 8 - 9 = 3460
12 + 3456 - 7 - 8 + 9 = 3462
12 - 3456 + 7 + 8 - 9 = -3438
12 - 3456 + 7 - 8 + 9 = -3436
12 - 3456 - 7 + 8 + 9 = -3434
123 + 4 + 5 - 6 - 789 = -663
123 + 4 - 5 + 6 - 789 = -661
123 + 4 - 5 - 6 + 789 = 905
123 - 4 + 5 + 6 - 789 = -659
123 - 4 + 5 - 6 + 789 = 907
123 - 4 - 5 + 6 + 789 = 909
123 + 4 + 5 - 67 - 89 = -24
123 + 4 - 5 + 67 - 89 = 100
123 + 4 - 5 - 67 + 89 = 144
123 - 4 + 5 + 67 - 89 = 102
123 - 4 + 5 - 67 + 89 = 146
123 - 4 - 5 + 67 + 89 = 270
123 + 4 + 5 - 678 - 9 = -555
123 + 4 - 5 + 678 - 9 = 791
123 + 4 - 5 - 678 + 9 = -547
123 - 4 + 5 + 678 - 9 = 793
123 - 4 + 5 - 678 + 9 = -545
123 - 4 - 5 + 678 + 9 = 801
123 + 4 + 56 - 7 - 89 = 87
123 + 4 - 56 + 7 - 89 = -11
123 + 4 - 56 - 7 + 89 = 153
123 - 4 + 56 + 7 - 89 = 93
123 - 4 + 56 - 7 + 89 = 257
123 - 4 - 56 + 7 + 89 = 159
123 + 4 + 56 - 78 - 9 = 96
123 + 4 - 56 + 78 - 9 = 140
123 + 4 - 56 - 78 + 9 = 2
123 - 4 + 56 + 78 - 9 = 244
123 - 4 + 56 - 78 + 9 = 106
123 - 4 - 56 + 78 + 9 = 150
123 + 4 + 567 - 8 - 9 = 677
123 + 4 - 567 + 8 - 9 = -441
123 + 4 - 567 - 8 + 9 = -439
123 - 4 + 567 + 8 - 9 = 685
123 - 4 + 567 - 8 + 9 = 687
123 - 4 - 567 + 8 + 9 = -431
123 + 45 + 6 - 7 - 89 = 78
123 + 45 - 6 + 7 - 89 = 80
123 + 45 - 6 - 7 + 89 = 244
123 - 45 + 6 + 7 - 89 = 2
123 - 45 + 6 - 7 + 89 = 166
123 - 45 - 6 + 7 + 89 = 168
123 + 45 + 6 - 78 - 9 = 87
123 + 45 - 6 + 78 - 9 = 231
123 + 45 - 6 - 78 + 9 = 93
123 - 45 + 6 + 78 - 9 = 153
123 - 45 + 6 - 78 + 9 = 15
123 - 45 - 6 + 78 + 9 = 159
123 + 45 + 67 - 8 - 9 = 218
123 + 45 - 67 + 8 - 9 = 100
123 + 45 - 67 - 8 + 9 = 102
123 - 45 + 67 + 8 - 9 = 144
123 - 45 + 67 - 8 + 9 = 146
123 - 45 - 67 + 8 + 9 = 28
123 + 456 + 7 - 8 - 9 = 569
123 + 456 - 7 + 8 - 9 = 571
123 + 456 - 7 - 8 + 9 = 573
123 - 456 + 7 + 8 - 9 = -327
123 - 456 + 7 - 8 + 9 = -325
123 - 456 - 7 + 8 + 9 = -323
1234 + 5 + 6 - 7 - 89 = 1149
1234 + 5 - 6 + 7 - 89 = 1151
1234 + 5 - 6 - 7 + 89 = 1315
1234 - 5 + 6 + 7 - 89 = 1153
1234 - 5 + 6 - 7 + 89 = 1317
1234 - 5 - 6 + 7 + 89 = 1319
1234 + 5 + 6 - 78 - 9 = 1158
1234 + 5 - 6 + 78 - 9 = 1302
1234 + 5 - 6 - 78 + 9 = 1164
1234 - 5 + 6 + 78 - 9 = 1304
1234 - 5 + 6 - 78 + 9 = 1166
1234 - 5 - 6 + 78 + 9 = 1310
1234 + 5 + 67 - 8 - 9 = 1289
1234 + 5 - 67 + 8 - 9 = 1171
1234 + 5 - 67 - 8 + 9 = 1173
1234 - 5 + 67 + 8 - 9 = 1295
1234 - 5 + 67 - 8 + 9 = 1297
1234 - 5 - 67 + 8 + 9 = 1179
1234 + 56 + 7 - 8 - 9 = 1280
1234 + 56 - 7 + 8 - 9 = 1282
1234 + 56 - 7 - 8 + 9 = 1284
1234 - 56 + 7 + 8 - 9 = 1184
1234 - 56 + 7 - 8 + 9 = 1186
1234 - 56 - 7 + 8 + 9 = 1188
12345 + 6 + 7 - 8 - 9 = 12341
12345 + 6 - 7 + 8 - 9 = 12343
12345 + 6 - 7 - 8 + 9 = 12345
12345 - 6 + 7 + 8 - 9 = 12345
12345 - 6 + 7 - 8 + 9 = 12347
12345 - 6 - 7 + 8 + 9 = 12349
Answered By: Sash Sinha
Categories: questions Tags:
Answers are sorted by their score. The answer accepted by the question owner as the best is marked with
at the top-right corner.