| Conditions | 4 |
| Paths | 4 |
| Total Lines | 14 |
| Code Lines | 8 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 2 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 26 | public static function findLengthOfLCIS2(array $nums): int |
||
| 27 | { |
||
| 28 | if (empty($nums)) { |
||
| 29 | return 0; |
||
| 30 | } |
||
| 31 | $n = count($nums); |
||
| 32 | $dp = array_fill(0, $n, 1); |
||
| 33 | for ($i = 1; $i < $n; $i++) { |
||
| 34 | if ($nums[$i] > $nums[$i - 1]) { |
||
| 35 | $dp[$i] = $dp[$i - 1] + 1; |
||
| 36 | } |
||
| 37 | } |
||
| 38 | |||
| 39 | return max($dp); |
||
| 40 | } |
||
| 42 |