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.
Am I supposed to check if the input is correct i.e. that there are three strings in the first line in input, not 5 , or numbers are integers etc? I checked only given constraints: that r is not less than 1 and not more than n, et cetera.
My algorithm works correctly with all correct inputs (9 for the test input, 8 for the input from lonely_wolf and my own tests). Algo is correct: but I get only first 6 tests positive. My algorithm computes the number of occupied spots of a set of overlaping (in principle) sets of intervals (c1,c2) of different rows. then it deducts them from m*n.
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Gridland Metro
You are viewing a single comment's thread. Return to all comments →
Am I supposed to check if the input is correct i.e. that there are three strings in the first line in input, not 5 , or numbers are integers etc? I checked only given constraints: that r is not less than 1 and not more than n, et cetera. My algorithm works correctly with all correct inputs (9 for the test input, 8 for the input from lonely_wolf and my own tests). Algo is correct: but I get only first 6 tests positive. My algorithm computes the number of occupied spots of a set of overlaping (in principle) sets of intervals (c1,c2) of different rows. then it deducts them from m*n.