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.
In this particular exercise, there is no difference. A char has an ascii value of 1 character and an int will store its value. They both do the job here because the numbers are 0 to 9. If the value exceeds 10, then I think int will be the proper method.
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
The Grid Search
You are viewing a single comment's thread. Return to all comments →
In this particular exercise, there is no difference. A char has an ascii value of 1 character and an int will store its value. They both do the job here because the numbers are 0 to 9. If the value exceeds 10, then I think int will be the proper method.