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