A question about interview street input constraints. (http://interviewstreet.com/)
Is it necessary to check the inputs for errors in the interviewstreet challenges?
For example, one challenge details the following constraints for the STDIN content:
1 <= N <= 1,00,000(10^5)
1 <= K <= N
0 <= profit value of any billboard <= 2,000,000,000(2*10^9)
Do I have to write some code to check the values to make sure that they meet these constraints or can I just assume that they do.
Also, if I do have to write the code to check what do I output if the inputs are incorrect?
Thanks
You can take it for graneted that inputs will always be adhering to the given constraints.
You don’t need write any extra code for checking if input is within given constraints.
So if they say N will be <= 1,00,000, you can use an array of exactly 1,00,000 to store the elements and you’ll be fine.