Skip to content

Commit

Permalink
Update 0091-decode-ways.java
Browse files Browse the repository at this point in the history
Removed unused dp array for the optimal solution.
  • Loading branch information
ColstonBod-oy authored Jun 21, 2023
1 parent 5f4f024 commit c17e095
Showing 1 changed file with 0 additions and 1 deletion.
1 change: 0 additions & 1 deletion java/0091-decode-ways.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
class Solution {

public int numDecodings(String s) {
int[] dp = new int[s.length() + 1];
int twoBack = 1; // empty string
int oneBack = s.charAt(0) == '0' ? 0 : 1;
int current = oneBack;
Expand Down

0 comments on commit c17e095

Please sign in to comment.