@@ -12,7 +12,7 @@ discard block |
||
| 12 | 12 | if ($n < 2) { |
| 13 | 13 | return $s; |
| 14 | 14 | } |
| 15 | - $helper = static function (string $s) { |
|
| 15 | + $helper = static function(string $s) { |
|
| 16 | 16 | $n = strlen($s); |
| 17 | 17 | for ($i = 0; $i < $n / 2; $i++) { |
| 18 | 18 | if ($s[$i] !== $s[$n - $i - 1]) { |
@@ -44,8 +44,8 @@ discard block |
||
| 44 | 44 | } |
| 45 | 45 | |
| 46 | 46 | $start = $length = 0; |
| 47 | - $helper = static function (string $s, int $l, int $r, int &$start, int &$length) { |
|
| 48 | - while ($l >= 0 && $r < strlen($s) && $s[$l ] === $s[$r]) { |
|
| 47 | + $helper = static function(string $s, int $l, int $r, int &$start, int &$length) { |
|
| 48 | + while ($l >= 0 && $r < strlen($s) && $s[$l] === $s[$r]) { |
|
| 49 | 49 | $l--; |
| 50 | 50 | $r++; |
| 51 | 51 | } |
@@ -85,7 +85,7 @@ discard block |
||
| 85 | 85 | $prev = $n - 1 - $j; |
| 86 | 86 | if ($prev + $dp[$i][$j] - 1 === $i) { |
| 87 | 87 | $max = $dp[$i][$j]; |
| 88 | - $len= $i; |
|
| 88 | + $len = $i; |
|
| 89 | 89 | } |
| 90 | 90 | } |
| 91 | 91 | } |
@@ -11,7 +11,7 @@ discard block |
||
| 11 | 11 | if (empty($s) || empty($t)) { |
| 12 | 12 | return false; |
| 13 | 13 | } |
| 14 | - $helper = static function (string &$s, int &$i) { |
|
| 14 | + $helper = static function(string &$s, int &$i) { |
|
| 15 | 15 | $n = 0; |
| 16 | 16 | while ($i >= 0 && ($n > 0 || $s[$i] === '#')) { |
| 17 | 17 | $n = $s[$i] === '#' ? $n + 1 : $n - 1; |
@@ -65,7 +65,7 @@ discard block |
||
| 65 | 65 | if (empty($s) || empty($t)) { |
| 66 | 66 | return false; |
| 67 | 67 | } |
| 68 | - $helper = static function (string $s, array $stack) { |
|
| 68 | + $helper = static function(string $s, array $stack) { |
|
| 69 | 69 | $n = strlen($s); |
| 70 | 70 | for ($i = 0; $i < $n; $i++) { |
| 71 | 71 | if ($s[$i] === '#') { |
@@ -65,7 +65,7 @@ |
||
| 65 | 65 | if (empty($p) || empty($q)) { |
| 66 | 66 | return []; |
| 67 | 67 | } |
| 68 | - $helper = static function (array $nums, int $target): bool { |
|
| 68 | + $helper = static function(array $nums, int $target): bool { |
|
| 69 | 69 | [$low, $high] = [0, count($nums) - 1]; |
| 70 | 70 | while ($low <= $high) { |
| 71 | 71 | $mid = $low + intdiv($high - $low, 2); |