Birthday Cake Candles

  • + 0 comments

    while (i>-1&&a[i--] == tallest) { count++; }

    You just forgot to check whether the index i is within the bounds.