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.
because in the problem statement it says - " rounded down to the nearest integer ".
So, if the avg value is 9999.5 or greater in decimal points, it should return 9999 and not 10000 (which only round() would have done).
Best choice is to use floor(), else do the workaround that I did.
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Average Population of Each Continent
You are viewing a single comment's thread. Return to all comments →
because in the problem statement it says - " rounded
down
to the nearest integer ". So, if the avg value is 9999.5 or greater in decimal points, it should return 9999 and not 10000 (which only round() would have done).Best choice is to use floor(), else do the workaround that I did.