You are viewing a single comment's thread. Return to all comments →
Did This...! Seems Simple right?
static int birthdayCakeCandles(int n, int[] ar) { // Complete this function int size=ar.length; int tall=ar[0]; int count=0;
for(int i=0 ; i<size ; i++) { if(ar[i]>tall) { tall=ar[i]; } } for(int j=0;j<size;j++) { if(ar[j]==tall) count++; } return count; }
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 →
Did This...! Seems Simple right?
static int birthdayCakeCandles(int n, int[] ar) { // Complete this function int size=ar.length; int tall=ar[0]; int count=0;