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.
Ahh, I see what lasani is saying. The test case give a number input of 9823, not separated by spaces. Unless you break it into 4 int, you'll have a single int of 9823 and that's wrong. however, if you have 9 8 2 3 as seperate integer within the array and still have problem. Then we'll have to look at your code.
In this case, reading it as a string allow us to get each char by accessing the string's index; thus, giving us 4 chars.
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 →
Ahh, I see what lasani is saying. The test case give a number input of 9823, not separated by spaces. Unless you break it into 4 int, you'll have a single int of 9823 and that's wrong. however, if you have 9 8 2 3 as seperate integer within the array and still have problem. Then we'll have to look at your code.
In this case, reading it as a string allow us to get each char by accessing the string's index; thus, giving us 4 chars.