Meet in the Middle
Medium
Execution time limit is 1 second
Runtime memory usage limit is 128-256 megabytes
You are given an array of numbers. In how many ways can you choose a subset of the numbers with sum ?
Input
The first line has two numbers and : the array size and the required sum.
The second line has integers : the numbers in the array.
Output
Print the number of ways you can create the sum .
Examples
Input #1
Answer #1
Input #2
Answer #2
Submissions 121
Acceptance rate 22%