src/main/java/Smaller.java
/**
     * Original simple version.
     * This is too slow, but works,
     * so used to validate a random collection.
     *
     * @param unsorted array of ints
     * @return array of counts of smaller ints to the right ...
     */
Original simple version.
This is too slow, but works,
so used to validate a random collection.

@param unsorted array of ints
@return array of counts of smaller ints to the right
Original simple version . This is too slow but works so used to validate a random collection . @param unsorted array of ints @return array of counts of smaller ints to the right
public static int[] oldSmaller(int[] unsorted) {
        return IntStream.range(0, unsorted.length)
                .map(pos -> (int) Arrays.stream(unsorted)
                        .skip(pos + 1)
                        .filter(n -> n < unsorted[pos])
                        .count())
                .toArray();
    }
public static int [ ] oldSmaller ( int [ ] unsorted ) { return IntStream . range ( 0 , unsorted . length ) . map ( pos -> ( int ) Arrays . stream ( unsorted ) . skip ( pos + 1 ) . filter ( n -> n < unsorted [ pos ] ) . count ( ) ) . toArray ( ) ; }
Original simple version.
Original simple version .