<p>Implement a function that takes a string of four digits as its argument, with each digit from 1 ──► 9 (inclusive) with repetitions allowed, and returns an arithmetic expression that evaluates to the number 24. If no such solution exists, return "no solution exists."</p>
<p>Rules:</p>
Only the following operators/functions are allowed: multiplication, division, addition, subtraction
Division should use floating point or rational arithmetic, etc, to preserve remainders.
Forming multiple digit numbers from the supplied digits is disallowed. (So an answer of 12+12 when given 1, 2, 2, and 1 is wrong).
The order of the digits when given does not have to be preserved.
testString: 'assert(include(answers[0], solve24(testCases[0])), ''<code>solve24("4878")</code> should return <code>(7-8/8)*4</code> or <code>4*(7-8/8)</code>'');'
testString: 'assert(include(answers[1], solve24(testCases[1])), ''<code>solve24("1234")</code> should return any arrangement of <code>1*2*3*4</code>'');'
testString: 'assert(include(answers[2], solve24(testCases[2])), ''<code>solve24("6789")</code> should return <code>(6*8)/(9-7)</code> or <code>(8*6)/(9-7)</code>'');'
testString: 'assert(include(answers[3], solve24(testCases[3])), ''<code>solve24("1127")</code> should return a permutation of <code>(1+7)*(1*2)</code>'');'