LearnPy Hub
← Arena
IntermediateRating 1450

Plus or Minus to Hit Target

Put a + or − in front of every number. Count the ways to make the total equal t.

Input

n and t, then n non-negative integers (sum ≤ 2000).

Output

One integer.

Sample 1

Input
5 3
1 1 1 1 1
Output
5

Sample 2

Input
1 1
1
Output
1
solution.py
Output appears here
Plus or Minus to Hit Target · Python Arena problem · LearnPy Hub