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.
according to me it shouldn't work but if it passed test cases ,then i dont know how .the reason is that consider a number like 73 ,then n%5 should give 3 ,and hence it would redirect to the else statement and print n, whereas it should have printed 75 as we need to consider the next multiple of 5 ,75-73 =2 (<3) .Correct me ,if i am wrong ,anyone. (might be i am wrong too :P ,i developed my solution in my way ,though!)
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Grading Students
You are viewing a single comment's thread. Return to all comments →
according to me it shouldn't work but if it passed test cases ,then i dont know how .the reason is that consider a number like 73 ,then n%5 should give 3 ,and hence it would redirect to the else statement and print n, whereas it should have printed 75 as we need to consider the next multiple of 5 ,75-73 =2 (<3) .Correct me ,if i am wrong ,anyone. (might be i am wrong too :P ,i developed my solution in my way ,though!)