Skip to content

Commit 7858443

Browse files
authored
Update UniqueSubsequencesCount.java
1 parent 892e365 commit 7858443

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/main/java/com/thealgorithms/dynamicprogramming/UniqueSubsequencesCount.java

+3-3
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,11 @@ private UniqueSubsequencesCount() {
1414
throw new UnsupportedOperationException("Utility class");
1515
}
1616

17-
private static int[] dp;
17+
private static Set<Character> set = new HashSet<>();
1818

1919
public static int subseqCount(String str) {
2020

21-
dp = new int[str.length() + 1];
21+
int[] dp = new int[str.length() + 1];
2222
Arrays.fill(dp, -1);
2323

2424
return recursiveCall(str, 0, dp);
@@ -34,7 +34,7 @@ public static int recursiveCall(String st, int idx, int[] dp) {
3434
return dp[idx];
3535
}
3636

37-
Set<Character> set = new HashSet<>();
37+
set = new HashSet<>();
3838

3939
int res = 0;
4040

0 commit comments

Comments
 (0)