Skip to content

Commit

Permalink
Update 0139-word-break.java
Browse files Browse the repository at this point in the history
for loop of  initialization is redundant because in java for boolean variables default initialization is false.
  • Loading branch information
nagswarnaa authored Jul 30, 2023
1 parent eeee241 commit a65ea37
Showing 1 changed file with 0 additions and 5 deletions.
5 changes: 0 additions & 5 deletions java/0139-word-break.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,6 @@ class Solution {
public boolean wordBreak(String s, List<String> wordDict) {
boolean[] dp = new boolean[s.length() + 1];


for (int i = 0; i < dp.length; i++) {
dp[i] = false;
}

dp[s.length()] = true;

for (int i = s.length() - 1; i >= 0; i--) {
Expand Down

0 comments on commit a65ea37

Please sign in to comment.