Notice
Recent Posts
Recent Comments
Link
반응형
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | 5 | ||
6 | 7 | 8 | 9 | 10 | 11 | 12 |
13 | 14 | 15 | 16 | 17 | 18 | 19 |
20 | 21 | 22 | 23 | 24 | 25 | 26 |
27 | 28 | 29 | 30 | 31 |
Tags
- JSON특징
- 변동성 돌파전략
- Web Server란
- spring
- JSON 형식
- 트레이딩 봇 만들기
- 프로그래머스 SQL
- 리눅스 777
- 즐겨찾기가 가장 많은 식당 정보 출력하기
- 파이썬 주식
- pybithumb
- WAS WebServer 차이
- 오라클
- string format
- 리눅스
- beautifulsoup
- JavaScript Obejct Notation
- 파이썬
- java
- BigDecimal
- Python
- 프로그래머스 소수
- 빗썸 API 사용
- 단순 반복 자동화
- Web Service Architecture
- WAS란
- 와스 웹서버의 차이
- 리눅스 rwx
- 프로그래머스
- 파이썬 가상환경
Archives
- Today
- Total
IT 개발자_S
해커랭크 Birthday Cake Candles 본문
반응형
#!/bin/python3
import math
import os
import random
import re
import sys
# Complete the birthdayCakeCandles function below.
def birthdayCakeCandles(ar):
ar.sort()
ar.reverse()
check = True
result =0
i =0
while(check) :
result +=1
if(ar[i] ==ar[i+1]):
i +=1
else :
return result
check =False
break
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()
------------------------------------
해당 입력시 런타임에러..
해결방안 ?
def birthdayCakeCandles(ar):
return ar.count(max(ar))
사용 해결!
반응형
'IT > 알고리즘_Python' 카테고리의 다른 글
해커랭크 Breaking the Records (0) | 2020.03.22 |
---|---|
해커랭크 Kangaroo PYTHON (0) | 2020.03.13 |
해커랭크 Apple and Orange (0) | 2020.03.12 |
해커랭크 Grading Strudents (0) | 2020.03.12 |
해커랭크 TIME Conversion python (0) | 2020.03.12 |
Comments