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.
Instead of appending to a list, you might have to take a variable with value 0 and then increment it in the IF loop. However, the problem with this kind of code(even I wrote the same) is this terminates because of the timeout error(though it is correct).
First comment in this section gives an absolute answer.
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Apple and Orange
You are viewing a single comment's thread. Return to all comments →
Instead of appending to a list, you might have to take a variable with value 0 and then increment it in the IF loop. However, the problem with this kind of code(even I wrote the same) is this terminates because of the timeout error(though it is correct). First comment in this section gives an absolute answer.