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.
deflibraryFine(d1,m1,y1,d2,m2,y2):# If the book is returned after the expected yearify1>y2:return10000# If the book is returned in the same year but after the expected monthelify1==y2andm1>m2:return(m1-m2)*500# If the book is returned in the same year and month but after the expected dayelify1==y2andm1==m2andd1>d2:return(d1-d2)*15# If the book is returned on or before the due dateelse:return0
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
An unexpected error occurred. Please try reloading the page. If problem persists, please contact support@hackerrank.com
Library Fine
You are viewing a single comment's thread. Return to all comments →