Statement

Given an array of positive integers, arr, and a target, T, build an expression using these numbers by inserting a ++ or a - before each integer, and evaluating this expression. Find the total number of different expressions that evaluate to T.

For example, considering an array [1, 1] and a target 0, we can build the following expressions:

Level up your interview prep. Join Educative to access 70+ hands-on prep courses.