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.
I see this kind of solution in many cases. But in fact this is wrong. This works only in case the first input is less than the second one. If the test case would be 12 and 11 then this failed the test case because the code does not enter into the for loop, because c is greater than b.
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 →
I see this kind of solution in many cases. But in fact this is wrong. This works only in case the first input is less than the second one. If the test case would be 12 and 11 then this failed the test case because the code does not enter into the for loop, because c is greater than b.