Skip to content

Commit

Permalink
DSA 单词拆分 不会做
Browse files Browse the repository at this point in the history
  • Loading branch information
qixiangyang committed Nov 27, 2019
1 parent 3beb4e7 commit d9b103e
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 9 deletions.
9 changes: 1 addition & 8 deletions Leetcode/00139_word_break.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,14 +33,7 @@


def wordBreak(s: str, wordDict) -> bool:

for i in wordDict:
s = s.replace(i, '')
if len(s) == 0:
return True
else:
return False

pass

s = "cars"
wordDict = ["car","ca","rs"]
Expand Down
2 changes: 1 addition & 1 deletion Leetcode/00146_lru_cache.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ def put(self, key: int, value: int) -> None:
self.cache[key] = value
else:
self.cache[key] = value
print(self.cache)
# print(self.cache)


# Your LRUCache object will be instantiated and called as such:
Expand Down

0 comments on commit d9b103e

Please sign in to comment.