But the page in the link provides only answers without an algorithm, that’s why I decided to write it myself.
At first let’s simplify the problem and use only ‘+’ and ‘-‘ operations, without concatenation of numbers. Then we will have some kind of a tree with 2 branches for each node, the left branch is ‘+’ operation, the right branch is ‘-‘ operation. For numbers [1 2 3 4] and sum=6 the tree will look like this:

Then we should modify the algorithm so that besides ‘+’ and ‘-‘ we can put ‘nothing’ between numbers. We will have the tree above, but with 3 child nodes for each node instead of 2. Also the ‘nothing’ operator will build slightly different nodes. Here is their comparison:

‘+’ operator: [1 2 3 4] sum 100 -> [2 3 4] sum 99

‘-‘ operator: [1 2 3 4] sum 100 -> [-2 3 4] sum 99

‘nothing’ operator: [1 2 3 4] sum 100 -> [12 3 4] sum 100

For the ‘+’ operator we call “findPaths(99, 2, index+1)”, for nothing operator we will call “findPaths(100, 12, index+1)”. Here is the updated algorithm:

Also there is another algorithm: to generate an array with all possible combinations, then parse each row and check its sum.
It is quite slower, but it is more generic and can work for other operations: