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.
Pretty poor solution. Unnecessary use of two for loops. You can do it in one for loop. The code would be easier to read if it was written using one loop and in the loop had an initial if/else structure that determines if the current number in the iteration is less than or equal to 9. If the count is less than 10, you have if statements that print the english word out, and if the count is greater than or equal to 10, then you do modulo to determine even or odd.
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
For Loop
You are viewing a single comment's thread. Return to all comments →
Pretty poor solution. Unnecessary use of two for loops. You can do it in one for loop. The code would be easier to read if it was written using one loop and in the loop had an initial if/else structure that determines if the current number in the iteration is less than or equal to 9. If the count is less than 10, you have if statements that print the english word out, and if the count is greater than or equal to 10, then you do modulo to determine even or odd.