public long rank(final int[] T) {
		if (T.length != k) {
			throw new IllegalArgumentException(
				"Invalid array size: %d != %d.".formatted(T.length, k)
			);
		}

		long rank = 0;

		for (int i = 0; i < k; ++i) {
			for (int j = (i == 0 ? 0 : T[i - 1] + 1); j < T[i]; ++j) {
				rank += BinomialCoefficient.apply(n - j - 1, k - i - 1);
			}
		}

		return rank;
	}
Return the <em>rank</em> of the given k-subset {@code T}.

@apiNote
This method doesn't check if the given array {@code T} represents a
valid k-subset. If {@code T} is <em>invalid</em>, the returned value is
just an arbitrary number. If a given array is a valid k-subset can be
checked with the {@link #contains(int[])} method.

@param T the k-subset
@return the rank of the k-subset
@throws IllegalArgumentException if {@code T.length != k}
@throws NullPointerException if {@code T} is {@code null}
jenetics.incubator/src/main/java/io/jenetics/incubator/combinatorial/KSubset.java