| Conditions | 5 |
| Paths | 5 |
| Total Lines | 15 |
| Code Lines | 8 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 2 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 9 | public static function containsDuplicate(array $nums): bool |
||
| 10 | { |
||
| 11 | if (empty($nums)) { |
||
| 12 | return false; |
||
| 13 | } |
||
| 14 | $n = count($nums); |
||
| 15 | for ($i = 0; $i < $n; $i++) { |
||
| 16 | for ($j = $i + 1; $j < $n; $j++) { |
||
| 17 | if ($nums[$i] === $nums[$j]) { |
||
| 18 | return true; |
||
| 19 | } |
||
| 20 | } |
||
| 21 | } |
||
| 22 | |||
| 23 | return false; |
||
| 24 | } |
||
| 57 |