Loading collection data...
Collections are a way for you to organize kata so that you can create your own training routines. Every collection you create is public and automatically sharable with other warriors. After you have added a few kata to a collection you and others can train on the kata contained within the collection.
Get started now by creating a new collection.
Not an issue.
You're welcome, and I hope that despite of all the problems, you like it ;)
This comment is hidden because it contains spoiler information about the solution
Aside from some "smaller" problems which might or might not make your solution to fail because of some subtle timing bugs and race conditions, there are two main problems which make you fail. I will try to hint you a bit without giving out too much ;)
First of all, try following test case:
It should run 4 tasks and finish after 6 seconds, but with your solution, following happens:
For some reason (which I know, and you have to find out) three tasks are scheduled, executed, and categorized properly, but fourth task is not. Find out why, and you are half way there ;)
This and another problem you can diagnose by comparing execution logs of my and yours solution:
Yours:
Mine:
One problem manifests at the top of your log, and the second one - near the bottom. I won't say more to not make things too easy, but I assure you that the cause of failing tests is in your code, and not in the tests. And both problems are strictly concurrency related, and not just some stupid mistakes, so I believe that when you finally find them, you will learn a lot (the first problem is almost identical to a gotcha which applies to C# solutions if they use default configuration of concurrency API). I even managed to fix the problems in your solution (modified one line, added a few) and it passed!
Good luck, and please come back with fresh ideas and try again!
This comment is hidden because it contains spoiler information about the solution
You can also try to remove all test cases except one from the sample tests and see if it behaves in expected way. For example, one of the test cases gives following result with your solution:
With my solution, and two solutions of other users, tests pass and that's why I am inclined towards opinion that your solution does not fulfill requirements related to waiting times.
Keep trying, and good luck!
I can check it when I get home but remember that whole test suite must run below 16 seconds, and not just one test method. did you try to run all basic tests locally at once? how long did they run? was it less than 16 seconds?
This comment is hidden because it contains spoiler information about the solution
Check following scenario: create ten actions, each of them sleeping for 8 seconds, and check how long does it take on your local environment? Remember that CodeWars timeouts all Java solutions that take more than 16 seconds.
This comment is hidden because it contains spoiler information about the solution
@Padmanarayanan: Did you print the input to verify the output yourself? I just passed the tests, and it worked ok.
If you still believe there's an issue with the tests, post your code (+ the test input) in reply and mark it as a spoiler.
That's going to be help pin down the issue quickly.
console.log(braces)
JavaScript:
I'm able to pass the 5 test cases provided, however I'm still failing test cases: 8, 10, 11 and 14. Is there not a way to see the inputs for these test cases?
Java unit tests are not working as intended