mirror of
https://github.com/trekhleb/javascript-algorithms.git
synced 2025-12-19 08:59:05 +08:00
Upgrade packages.
This commit is contained in:
@@ -88,18 +88,18 @@ export default function regularExpressionMatching(string, pattern) {
|
||||
matchMatrix[rowIndex][columnIndex] = true;
|
||||
} else if (
|
||||
(
|
||||
pattern[patternIndex - 1] === string[stringIndex] ||
|
||||
pattern[patternIndex - 1] === ANY_CHAR
|
||||
) &&
|
||||
matchMatrix[rowIndex - 1][columnIndex] === true
|
||||
pattern[patternIndex - 1] === string[stringIndex]
|
||||
|| pattern[patternIndex - 1] === ANY_CHAR
|
||||
)
|
||||
&& matchMatrix[rowIndex - 1][columnIndex] === true
|
||||
) {
|
||||
matchMatrix[rowIndex][columnIndex] = true;
|
||||
} else {
|
||||
matchMatrix[rowIndex][columnIndex] = false;
|
||||
}
|
||||
} else if (
|
||||
pattern[patternIndex] === string[stringIndex] ||
|
||||
pattern[patternIndex] === ANY_CHAR
|
||||
pattern[patternIndex] === string[stringIndex]
|
||||
|| pattern[patternIndex] === ANY_CHAR
|
||||
) {
|
||||
/*
|
||||
* In case if current pattern char is the same as current string char
|
||||
|
||||
@@ -40,8 +40,8 @@ function buildZArray(zString) {
|
||||
// more characters that are equal to the ones in the prefix we will expand
|
||||
// right Z box boundary by 3.
|
||||
while (
|
||||
zBoxRightIndex < zString.length &&
|
||||
zString[zBoxRightIndex - zBoxLeftIndex] === zString[zBoxRightIndex]
|
||||
zBoxRightIndex < zString.length
|
||||
&& zString[zBoxRightIndex - zBoxLeftIndex] === zString[zBoxRightIndex]
|
||||
) {
|
||||
// Expanding Z box right boundary.
|
||||
zBoxRightIndex += 1;
|
||||
@@ -81,8 +81,8 @@ function buildZArray(zString) {
|
||||
// And start comparing characters one by one as we normally do for the case
|
||||
// when we are outside of checkbox.
|
||||
while (
|
||||
zBoxRightIndex < zString.length &&
|
||||
zString[zBoxRightIndex - zBoxLeftIndex] === zString[zBoxRightIndex]
|
||||
zBoxRightIndex < zString.length
|
||||
&& zString[zBoxRightIndex - zBoxLeftIndex] === zString[zBoxRightIndex]
|
||||
) {
|
||||
zBoxRightIndex += 1;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user