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.
If speed is all that matters, then you pre-calculate every year and store them in an array, where the year is the index into the array. Pre-calculate means you use pen and paper and figure it out and then you hard code it.
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Day of the Programmer
You are viewing a single comment's thread. Return to all comments →
If speed is all that matters, then you pre-calculate every year and store them in an array, where the year is the index into the array. Pre-calculate means you use pen and paper and figure it out and then you hard code it.