| Conditions | 2 |
| Paths | 2 |
| Total Lines | 12 |
| Code Lines | 8 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 2 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 49 | private static function helper(array $nums, int $start, int $end): int |
||
| 50 | { |
||
| 51 | $prev = $nums[$start]; |
||
| 52 | $next = max($prev, $nums[$start + 1]); |
||
| 53 | $result = $next; |
||
| 54 | for ($i = $start + 2; $i <= $end; $i++) { |
||
| 55 | $result = max($prev + $nums[$i], $next); |
||
| 56 | $prev = $next; |
||
| 57 | $next = $result; |
||
| 58 | } |
||
| 59 | |||
| 60 | return $result; |
||
| 61 | } |
||
| 63 |