Birthday Cake Candles

Sort by

recency

|

5302 Discussions

|

  • + 0 comments
    def birthdayCakeCandles(candles):
        # Write your code here
        return candles.count(max(candles))
    
  • + 0 comments

    Python3

    print(candles.count(max(candles)))

  • + 0 comments
    1. code is in python

    2. n = int(input())
    3. x = list(map(int,input().split()))
    4. max_num = 0
    5. for i in x:
    6. if max_num
    7. max_num = i
    8. print(x.count(max_num))
  • + 0 comments
    1. code is in python
    2. from collections import Counter
    3. n = int(input())
    4. x = list(map(int,input().split()))
    5. counter = Counter(x)
    6. max_value = max(counter)
    7. print(counter[max_value])
  • + 0 comments

    java solution i made ..

    int max = Integer.MIN_VALUE;
     for(int i = 0 ;i<candles.size();i++){
      if(max<candles.get(i)){
         max = candles.get(i); i=0; }
    	 if(max>candles.get(i)){
    	candles.remove(i); i=0; }
    		} return candles.size(); }