Given 4 numbers n1, n2, n3, n4, and a goal n5, obtain n5 using n1 through n4 combined with any operations.
Eg. Given four numbers 2,3,4,5 and the goal as 8, output (one of many) is 2-3+4+5
EDIT: This is a variation of a game played at my son's school. Paranthesis, powers, unary operations (log, factorial) are allowed; the expressions tend to get complicated. However, unary operations can be applied only once on a number. Essentially, the tree should be:
goal
/\
/ \
/ \
expression1 expression2
/\ /\
/ \ / \
/ \ / \
term1 term2 term3 term4
where term#i is either
1. one of the numbers, or
2. one of the numbers with an unary operation.