Skip to content
Merged

July09 #1694

Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
from typing import List


class Solution:
def wordBreak(self, s: str, wordDict: List[str]) -> bool:
words = set(wordDict)
n = len(s)

# dp[i] is True if s[:i] can be segmented into dictionary words.
# Empty prefix is trivially segmentable.
dp = [False] * (n + 1)
Expand Down
Loading