Skip to content

Commit b1b698c

Browse files
refactor 494
1 parent aa61585 commit b1b698c

File tree

1 file changed

+0
-28
lines changed
  • src/main/java/com/fishercoder/solutions

1 file changed

+0
-28
lines changed

src/main/java/com/fishercoder/solutions/_494.java

Lines changed: 0 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,5 @@
11
package com.fishercoder.solutions;
22

3-
/**
4-
* 494. Target Sum
5-
*
6-
* You are given a list of non-negative integers, a1, a2, ..., an, and a target, S.
7-
* Now you have 2 symbols + and -. For each integer, you should choose one from + and - as its new symbol.
8-
* Find out how many ways to assign symbols to make sum of integers equal to target S.
9-
10-
Example 1:
11-
12-
Input: nums is [1, 1, 1, 1, 1], S is 3.
13-
Output: 5
14-
Explanation:
15-
16-
-1+1+1+1+1 = 3
17-
+1-1+1+1+1 = 3
18-
+1+1-1+1+1 = 3
19-
+1+1+1-1+1 = 3
20-
+1+1+1+1-1 = 3
21-
22-
There are 5 ways to assign symbols to make the sum of nums be target 3.
23-
24-
Note:
25-
26-
The length of the given array is positive and will not exceed 20.
27-
The sum of elements in the given array will not exceed 1000.
28-
Your output answer is guaranteed to be fitted in a 32-bit integer.
29-
30-
*/
313
public class _494 {
324

335
public static class Solution1 {

0 commit comments

Comments
 (0)