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.
The input format requires the second line to be n space seperated numbers. But the test cases two and three both have less than n numbers. Maybe that's why our code fails, because we do cin till n, but there are no inputs. A try catch block may help.
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Marc's Cakewalk
You are viewing a single comment's thread. Return to all comments →
The input format requires the second line to be n space seperated numbers. But the test cases two and three both have less than n numbers. Maybe that's why our code fails, because we do cin till n, but there are no inputs. A try catch block may help.