You are viewing a single comment's thread. Return to all comments →
while (i>-1&&a[i--] == tallest) { count++; }
You just forgot to check whether the index i is within the bounds.
Birthday Cake Candles
You are viewing a single comment's thread. Return to all comments →
while (i>-1&&a[i--] == tallest) { count++; }
You just forgot to check whether the index i is within the bounds.