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.
Hi. This code passes all HackerRank tests. I think you may be misunderstanding what the constraints are for. You have to make your code work on any values it is given that fall within the constraints. That does not mean you have to specifically add the constraints to the problem.
No RodneyShag,
The algorithm must efficiently works in unexpected conditions. I mean is we can't check just run our codes on correct values. We MUST check the incorrect values and handle them.
no man ...all hackerrank testcases test your code flexibility and are not at all poor...if you dont beleive me download test cases and analyze it..if you did something wrong in your code..it will help a lot to debug your code
I agree with you. I checked the constraints cases and my code failed on two tests but if I don't check constraints the code will be passed all test cases. This challenge is suck 🤪
Java Substring
You are viewing a single comment's thread. Return to all comments →
Java solution
From my HackerRank Java solutions.
you did not add any of the constraints mentioned in the problem statement. if this code worked then the test cases are very poor.
Hi. This code passes all HackerRank tests. I think you may be misunderstanding what the constraints are for. You have to make your code work on any values it is given that fall within the constraints. That does not mean you have to specifically add the constraints to the problem.
Hope this helps.
HackerRank solutions.
No RodneyShag, The algorithm must efficiently works in unexpected conditions. I mean is we can't check just run our codes on correct values. We MUST check the incorrect values and handle them.
no man ...all hackerrank testcases test your code flexibility and are not at all poor...if you dont beleive me download test cases and analyze it..if you did something wrong in your code..it will help a lot to debug your code
I agree with you. I checked the constraints cases and my code failed on two tests but if I don't check constraints the code will be passed all test cases. This challenge is suck 🤪
Agree with you
What is the purpose of scan.close()?
opens a Scanner to read from System.in. This takes resources. scan.close() closes these resources when we are done with them, which is good practice.
HackerRank solutions.
can anybody plz let me known that why we have used scan.next and not scan.nextline in the above code
All the above codes including yours also are throwing exception