def dayOfProgrammer(year):
# Write your code here
if year == 1918:
return '26.09.1918'
check = False
# Julian
if ((year <= 1917) and (year % 4 == 0)):
check = True
# Gregorian
elif (year % 400 == 0) or ((year % 4 == 0) and (year % 100 != 0)):
check = True
tday = 244 if check else 243
return '{:02d}.09.{:04d}'.format(256 - tday, year)
'# 코딩 문제 관련 > 파이썬' 카테고리의 다른 글
[HackerRank-Python] Sales by Match (0) | 2022.07.07 |
---|---|
[HackerRank-python] Bill Division (0) | 2022.07.03 |
[HackerRank-python] Migratory Birds (0) | 2022.07.03 |
[HackerRank-python] Divisible Sum Pairs (0) | 2022.07.03 |
[HackerRank-python] Subarray Division (0) | 2022.07.03 |