Object of the game: Given 4 positive integer numbers, perform elementary operations on the 4 numbers so that the result gives you 24. i.e. given 9,6,5,3 a correct way to yield 24 is (6-3)*5+9 = 24 Note: Some 4 numbers may have multiple solutions while others may have no solutions such as 1,1,1,1. Also, you may only use each number once! The elementary operations that are allowed to be used are x,/,+,-,()
I was looking to write a program in order to compute the solution if it exists given 4 positive integer numbers. As of right now the only thing my mind is pointing me towards is using a brute force style of method to compute the solution. Wanted to know if you guys had any solutions
Any advice would be much appreciated!