Code Duplication    Length = 5-5 lines in 2 locations

src/Lesson04/MaxProductOfThree.php 2 locations

@@ 43-47 (lines=5) @@
40
    {
41
        $arrayCount = count($A);
42
        $allPositives = [];
43
        for ($i = $arrayCount - 3; $i < $arrayCount; $i++) {
44
            if ($A[$i] >= 0) {
45
                $allPositives[] = $A[$i];
46
            }
47
        }
48
49
        return $allPositives;
50
    }
@@ 68-72 (lines=5) @@
65
        $allNegatives = [];
66
        $twoNegatives = [];
67
        if (count($allPositives) === 0) {
68
            for ($i = $arrayCount - 3; $i < $arrayCount; $i++) {
69
                if ($A[$i] < 0) {
70
                    $allNegatives[] = $A[$i];
71
                }
72
            }
73
74
            return [$allNegatives, $twoNegatives];
75
        } else {