https://www.hackerrank.com/challenges/birthday-cake-candles/problem
HackerRank - Birthday Cake Candles
#!/bin/python3
import math
import os
import random
import re
import sys
def birthdayCakeCandles(ar):
ar.sort(reverse=True)
highestCandleLength = ar[0]
numberCandlesCanBlow = ar.count(highestCandleLength)
return numberCandlesCanBlow
if __name__ == '__main__':
fptr = open(os.environ['OUTPUT_PATH'], 'w')
ar_count = int(input())
ar = list(map(int, input().rstrip().split()))
result = birthdayCakeCandles(ar)
fptr.write(str(result) + '\n')
fptr.close()
'알고리즘 문제 풀기 > HackerRank' 카테고리의 다른 글
HackerRank - Grading Students (0) | 2019.01.17 |
---|---|
HackerRank - Time Conversion (0) | 2019.01.16 |
HackerRank - Mini-Max Sum (0) | 2019.01.14 |
HackerRank - Staircase (0) | 2019.01.13 |
HackerRank - Plus Minus (0) | 2019.01.12 |