def sparse_poly_to_integer(degrees, coeffs, order):
    """
    Converts polynomial to decimal representation.

    Parameters
    ----------
    degrees : array_like
        List of degrees of non-zero coefficients.
    coeffs : array_like
        List of non-zero coefficients.
    order : int
        The coefficient's field order.

    Returns
    -------
    int
        The decimal representation.
    """
    assert len(degrees) == len(coeffs)
    order = int(order)
    decimal = 0
    for d, c in zip(degrees, coeffs):
        decimal += int(c) * order**int(d)
    return decimal