Question: Write a program that outputs all possibilities to put + or - or nothing between the numbers 1
This question can be solved with the divide-and-conquer paradigm. Let's break this down into mathematical equations, and try to see what we come up with.
So first, we have the base question. The function f() takes in numbers 1..9, and based on the conditions given, returns 100.f(1..9) = 100
The question says we may use +, - or concatenate two consecutive numbers, so we can break this down into three components.
Came up with a better solution or have a question? Comment below!
Next Challenge: FizzBuzz