We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
- Prepare
- Algorithms
- Implementation
- Library Fine
- Discussions
Library Fine
Library Fine
Sort by
recency
|
1007 Discussions
|
Please Login in order to post a comment
My solution in C:
JavaScript
Python
def libraryFine(d1, m1, y1, d2, m2, y2): if y1==y2 and m1==m2 and d1==d2: return 0 elif y1==y2 and m1==m2 and d1>d2: return (d1-d2) * 15 elif y1==y2 and m1>m2: return (m1-m2) * 500 elif y1>y2: return (y1-y2) * 10000 else: return 0
Hi there! Here's my Java solution:
https://github.com/eduardocintra/hacker-rank-solutions/blob/master/src/br/com/eduardocintra/easy/libraryfine/LibraryFine.java