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.
Good practice would be to not assume such things, so your intuition is spot on. A simple check at the beginning of the function hurts nothing, as so...
inta,b;cin>>a;cin>>b;if((b-a)<0)return0;//or whatever other error handling is needed
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 →
Good practice would be to not assume such things, so your intuition is spot on. A simple check at the beginning of the function hurts nothing, as so...