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.
Hi patrick :) I solved your kata and I was thinking it would be even better if you add some random test cases cause now some users could just hard code their values in the function and succeed.
Thanks for pointing that out, I've updated the description accordingly. I chose to exclude the end of ranges for practical reasons.
Nice kata - an interesting real world problem, and the test cases are well set up. I am so pleased with myself for finishing it (without looking it up)!
Yeah ) Still, excluding the end of a range of discrete values is usually more convenient. It should probably be explicitly stated in the description, though.
regarding the test case:
checkAvailability([["09:30", "10:15"], ["12:20", "15:50"]], "10:15") => true
In my experience, any meeting scheduled to finish at 10:15, say, would most often not have finished at that time :)
This comment is hidden because it contains spoiler information about the solution
Neat use of join(). I am just wondering if ((i<<1)-1) might be faster generally as well as marginally less code than ((i-1)*2+1).
I am aware that my solution passes the original tests. It also passes the two extra tests I mention in my question.
My problem is that the "best practices" solution (ColbyDauph,alexcaza et al) does not pass the two new tests.
Is there something wrong with the tests? They seem logical to me.
Thank you for helping with this btw.
Your solution seems just fine, it passes all tests when I submit it. Please try again later - sometimes codewars engine fails. It happens very rarely though.
Please try to submit again.
Help please.
If I complete the set of tests with:
Test.assertEquals(dog_dont_bark_by_default(true), SLEEP, 'Should NOT bark if told so');
and
Test.assertEquals(dog_bark_by_default(true), BARK, 'Should bark by default');
the accepted solution fails these tests.
This comment is hidden because it contains spoiler information about the solution