You are viewing a single comment's thread. Return to all comments →
Solid solution. Wouldn't it be more efficient to do a for loop such as
//call sort //set int max = ar[n] for(int i = n; i>0; i++) { if(ar[i]==max) { count++; } else{ break; } return count; }
So you can avoid calling both sort and reverse? Not trying to correct you, genuine question
Seems like cookies are disabled on this browser, please enable them to open this website
Birthday Cake Candles
You are viewing a single comment's thread. Return to all comments →
Solid solution. Wouldn't it be more efficient to do a for loop such as
So you can avoid calling both sort and reverse? Not trying to correct you, genuine question