private function reducePairs(array $pairs, array $pair): array
    {
        $pairs[$pair[0]] = $pairs[$pair[0]] ?? [];
        $pairs[$pair[0]][] = $pair;

        return $pairs;
    }
private function reducePairs(array $pairs, array $pair): array
    {
        $pairs[$pair[0]] = $pairs[$pair[0]] ?? [];
        $pairs[$pair[0]][] = $pair;

        return $pairs;
    }
private function reducePairs ( array $ pairs , array $ pair ) : array { $ pairs [ $ pair [ 0 ] ] = $ pairs [ $ pair [ 0 ] ] ?? [ ] ; $ pairs [ $ pair [ 0 ] ] [ ] = $ pair ; return $ pairs ; }
Reduce pairs to help sorting them according to their keys.
Reduce pairs to help sorting them according to their keys .