import math


def compute_back_test_paths(n_splits: int, n_test_splits: int) -> int:
    """
    Compute the number of backtest paths for the combinatorial crossvalidation.

    As explained in pg. 164 of De Prado book this function calculates
    the number of paths that can be used given the total number of splits
    (`n_splits`) and the test splits (`n_test_splits`).

    :param n_splits: the total number of splits
    :type n_splits: int
    :param n_test_splits: the number of splits used in the test set
    :type n_test_splits: int
    :return: number of the backtest paths
    :rtype: int
    """
    den = 1

    for i in range(1, n_test_splits):
        den = den * (n_splits - i)

    return int(den / math.factorial(n_test_splits - 1))