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.
You only need to map 1-13,15,18,20,30,40 and 50. Then everything is either in the map, or a combination of ('twenty' + 'three') or a teen ('seven' + 'teen').
Still, a giant pain to code, but actually a good program for new coders to think of all the conditions, and try to write the most elegant solution (i.e. don't map out every minute!)
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
The Time in Words
You are viewing a single comment's thread. Return to all comments →
You only need to map 1-13,15,18,20,30,40 and 50. Then everything is either in the map, or a combination of ('twenty' + 'three') or a teen ('seven' + 'teen').
Still, a giant pain to code, but actually a good program for new coders to think of all the conditions, and try to write the most elegant solution (i.e. don't map out every minute!)