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.
Your solution is certainly the most elegant, but when the user is first presented with the problem in the coding box, the return command has already been given the object 'year' and we are given a #Write your logic here note above it. So it's at least forgivable for some of us to construct multiple 'if' blocks to solve it, wouldn't you agree?
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Write a function
You are viewing a single comment's thread. Return to all comments →
Your solution is certainly the most elegant, but when the user is first presented with the problem in the coding box, the return command has already been given the object 'year' and we are given a #Write your logic here note above it. So it's at least forgivable for some of us to construct multiple 'if' blocks to solve it, wouldn't you agree?