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.
publicstaticintlibraryFine(intd1,intm1,inty1,intd2,intm2,inty2){// Write your code hereintfineWithinSameMonth=15;intfineWithinSameYear=500;if(y1>y2){return10000;}elseif(y1==y2){if(m1>m2){return(m1-m2)*fineWithinSameYear;}elseif(m1==m2&d1>d2){return(d1-d2)*fineWithinSameMonth;}}return0;}
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Library Fine
You are viewing a single comment's thread. Return to all comments →
Java 8 based