Merge pull request #1372 from Jerry-306/patch-53

纠正 0093.复制IP地址 JavaScript 版本代码
This commit is contained in:
程序员Carl 2022-06-14 09:38:19 +08:00 committed by GitHub
commit 7d9d2d104a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -444,7 +444,7 @@ var restoreIpAddresses = function(s) {
return;
}
for(let j = i; j < s.length; j++) {
const str = s.substr(i, j - i + 1);
const str = s.slice(i, j + 1);
if(str.length > 3 || +str > 255) break;
if(str.length > 1 && str[0] === "0") break;
path.push(str);