calculateTestCount method

int calculateTestCount()

Gat test count of all the elements

Implementation

int calculateTestCount() {
  int num = 1;
  int sum = 0;
  for(int i = 1; i<numElements; i++){
    if(elements[i]!.max){
      num--;
    }
    else{
      sum += num;
      num++;
    }
  }
  return sum;
}