Challenges
Dynamic Programming You are given the digits 1,2,3,4,5,6,7,8,9. You may add '+' and '-' operations in between any of the digits. You may also join digits together to form a bigger number. The digits must stay in the original order however. Your aim is to do this in such a way that the result of the equation is a number that the user provides. Create a program which will ask the user for a number then find every possible solution. Here is an example that results in 50:
1 - 2 + 34 + 5 + 6 + 7 + 8 - 9 = 50
You could solve this by brute force (trying every possible combination) but it may be better to look at dynamic programming.