Project Euler #93: Arithmetic expressions

  • + 0 comments

    Brackets can be understood as which one you calculate together. If you generate all possible sub-groups, the problem is same as not have brackets.

    My approach was

    GenerateCombinatations of give size(starting with 4) with given input (starting with all 10 digits)

    We need to work on each of these but we can again use same method to generate more combinations of size 3. Then same method to generate more combination of size 2.

    Perform all operations whenever you have group of size two, you get six possibilities:

    a+b , a*b, a-b , b-a , a/b , b/a,

    you need to use floating point numbers. Recombine the results, recalculated till group size reduces to 1. When are at a single answer at this to result set of the topLevelGroup. Find max sequence number in each result set.