Birthday Cake Candles

  • + 1 comment

    I liked it

    counts = {}
    
    greatest = 0
    for i in range(0, len(candles)):
    
    		# Count each number repeatition
    		if counts.get(f"{candles[i]}") is None:
    				counts[f"{candles[i]}"] = 1
    
    		else:
    				counts[f"{candles[i]}"] += 1
    
    		# Identify the greatest number
    		if not greatest:
    				greatest = candles[i]
    
    		elif candles[i] > greatest:
    				greatest = candles[i]
    
    
    return counts[f"{greatest}"]