Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Updated answer for 139. Word Break#18

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Open
daxapps wants to merge1 commit intochihungyu1116:master
base:master
Choose a base branch
Loading
fromdaxapps:update/139-word-break
Open
Changes fromall 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
4 changes: 2 additions & 2 deletions139 Word Break.js
View file
Open in desktop
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
/**
* @param {string} s
* @param {set<string>} wordDict
* @param {set<string>} wordDict changed to @param {string[]} wordDict
* Note: wordDict is a Set object, see:
* https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Set
* @return {boolean}
Expand All@@ -17,7 +17,7 @@ var wordBreak = function(s, wordDict) {
if(possible[i]) {
for(var j = i + 1; j <= s.length; j++) {
var str = s.substring(i, j);
if(wordDict.has(str)) {
if(wordDict.includes(str)) {
possible[j] = true;
}
}
Expand Down

[8]ページ先頭

©2009-2025 Movatter.jp