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 am desperatly close to completition. I am using connected components to find the number of days required to solve the problems. I create a graph based on the constraints. My algorithm works for smaller data sets N < lets say. This is not concrete but seems to be the general happenings. This is why I cant figure out whats wrong. Not only is it impossible (nearly so) to work out the solutions to large data sets on paper usign my algorithm, I dont understand why it not only works for what seems to be smaller data sets but comes desperatly close for all the others, as in off by only a few for wrong answers. I dont know what could possible be wrong. I can give more details if any body can be bothered helping me. This would be my first problem on hacker rank being solved and would greatly motivate me to solve more, I just need to put away one first . So somebody help me??
Hi @jporcelli, I am stuck at the question. Can you explain how did u solve the question? I am checking every number with the numbers following it with complexity O(n^2).For some cases i am getting right answer but wrong for others.What is the key point in question?
@jporcelli I don't think you can use connected components. It'll find all possible paths from a starting vertex. You have to find one path per iteration.
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Join us
Create a HackerRank account
Be part of a 26 million-strong community of developers
Please signup or login in order to view this challenge
Problem solving
You are viewing a single comment's thread. Return to all comments →
I am desperatly close to completition. I am using connected components to find the number of days required to solve the problems. I create a graph based on the constraints. My algorithm works for smaller data sets N < lets say. This is not concrete but seems to be the general happenings. This is why I cant figure out whats wrong. Not only is it impossible (nearly so) to work out the solutions to large data sets on paper usign my algorithm, I dont understand why it not only works for what seems to be smaller data sets but comes desperatly close for all the others, as in off by only a few for wrong answers. I dont know what could possible be wrong. I can give more details if any body can be bothered helping me. This would be my first problem on hacker rank being solved and would greatly motivate me to solve more, I just need to put away one first . So somebody help me??
Did you know you can download the test-cases using hackos?
It'd be useful if you could use those as custom input, but there is a 50KB input limit...
Hi @jporcelli, I am stuck at the question. Can you explain how did u solve the question? I am checking every number with the numbers following it with complexity O(n^2).For some cases i am getting right answer but wrong for others.What is the key point in question?
@jporcelli I don't think you can use connected components. It'll find all possible paths from a starting vertex. You have to find one path per iteration.