Skip to content

Commit 90a1f79

Browse files
committed
Update Solution.java
1 parent c7e1909 commit 90a1f79

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/main/java/g0401_0500/s0494_target_sum/Solution.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@ public int findTargetSumWays(int[] nums, int target) {
1717
return solve(nums, sum / 2);
1818
}
1919

20-
private int solve(int nums[], int target) {
21-
int prev[] = new int[target + 1];
20+
private int solve(int[] nums, int target) {
21+
int[] prev = new int[target + 1];
2222
if (nums[0] == 0) {
2323
prev[0] = 2;
2424
} else {
@@ -29,7 +29,7 @@ private int solve(int nums[], int target) {
2929
}
3030
int n = nums.length;
3131
for (int i = 1; i < n; i++) {
32-
int curr[] = new int[target + 1];
32+
int[] curr = new int[target + 1];
3333
for (int j = 0; j <= target; j++) {
3434
int taken = 0;
3535
if (j >= nums[i]) {

0 commit comments

Comments
 (0)