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 |
Tags
- java
- JSON특징
- 리눅스 777
- 프로그래머스
- 빗썸 API 사용
- 프로그래머스 소수
- 파이썬 가상환경
- 오라클
- 리눅스
- 즐겨찾기가 가장 많은 식당 정보 출력하기
- Web Server란
- 파이썬
- Python
- spring
- WAS WebServer 차이
- 트레이딩 봇 만들기
- BigDecimal
- Web Service Architecture
- 와스 웹서버의 차이
- JavaScript Obejct Notation
- 프로그래머스 SQL
- pybithumb
- string format
- 변동성 돌파전략
- 리눅스 rwx
- JSON 형식
- 파이썬 주식
- 단순 반복 자동화
- beautifulsoup
- WAS란
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