Saturday, April 18, 2015

HackerRank::Algorithms::Warmup::Sherlock and The Beast

N is maximum 100000, and based on that here is a very very simple solution. Simply take all the numbers which are divisible by 3 which will show the numbers of 5s, then check if the remaining number of digits is divisible on 5, if it is, then we should update our answer, and in the end print it out.



No comments:

Post a Comment