def libraryFine(d1, m1, y1, d2, m2, y2):
# Write your code here
fine = 0
if y1 <= y2 and m1 <= m2 and d1 <= d2:
return fine
else:
if y1 == y2 and m1 == m2 and d1 >= d2:
d_diff = d1 - d2
fine += (15 * d_diff)
elif y1 == y2 and m1 >= m2:
m_diff = m1 - m2
fine += (500 * m_diff)
elif y1 >= y2:
y_diff = y1 - y2
fine += (10000 * y_diff)
return fine
'# 코딩 문제 관련 > 파이썬' 카테고리의 다른 글
[HackerRank-python] Non-Divisible Subset (0) | 2022.08.14 |
---|---|
[HackerRank-python] Cut the sticks (0) | 2022.08.11 |
[HackerRank-python] Sherlock and Squares (0) | 2022.08.09 |
[HackerRank-python] Append and Delete (0) | 2022.08.03 |
[HackerRank-python] Find Digits (0) | 2022.07.30 |