if there are at least two elements in between i and indexGreater find the Number of ways to select two points out of these
if ( numberOfElements >= 2 ) { ways += ( numberOfElements * ( numberOfElements - 1 ) / 2 ) ; } } return ways ; }