int birthdayCakeCandles(vector<int> candles) {
int answer=0;
sort(candles.begin(), candles.end());
answer=count(candles.begin(), candles.end(), candles.back());
return answer;
}
def birthdayCakeCandles(candles):
return candles.count(sorted(candles)[len(candles)-1])
[HackerRank] Two Strings (python) (0) | 2021.01.14 |
---|---|
[HackerRank] Hash Tables: Ransom Note (C++) (0) | 2021.01.14 |
[프로그래머스] 체육복 (탐욕법(Greedy)) (0) | 2021.01.13 |
[HackerRank] Left Rotation (Python, C++) (0) | 2021.01.12 |
[HackerRank] 2D Array - DS (Python) (0) | 2021.01.12 |