Contribution to the answer would be the multiplication of the possible values for the first and the third element
answer += ( first + 1 ) * ( len ( indices [ z ] ) - third ) NEW_LINE return answer NEW_LINE