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.
No good for beginners, IMO. Using object properties, and requiring knowledge of modulo doesn't seem like 8 Kyu to me. I think the idea is great though, and a simple list version would work well at 7 Kyu.
What am I missing here: "6 has 2 on bits (000...0011)"?
Aren't there multiple ways to express numbers using words? E.g "nine hundred ninety nine", or "nine hundred and ninety nine", or "nine hundred and ninety-nine". Do we ned to use a specific format to pass the tests?
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
Oh, since posting that last message, I can!
St3f4n I can't read your reply as it's hidden (I guess because I haven't yet passed the kata, or maybe it contains code?)
This comment is hidden because it contains spoiler information about the solution
Different behaviour on local machine if using
end()
in PHP - Codewars version gives errorOnly variables should be passed by reference
See solution here: http://stackoverflow.com/questions/4636166/only-variables-should-be-passed-by-reference
This fixed it:
Thanks for the input @donaldsebleung and @myjinxin2015. A very educational experience!
This is a top tip "You can check the (randomized) input passed into your function by using echo." - like so many things, obvious with hindsight!
I think my solution addresses the issue of both the items being too heavy, and returns 0, as expected. As I have stated, all the basic test cases pass, which is why I have requested an example of a random test case which will not pass so I have some idea of what might be wrong with my solution. All I can think of at present is that some of the constraints in the problem definition (e.g. "Constraints: 2 ≤ value1 ≤ 50") are not being tested for in my solution, but like I have mentioned there are no instructions on what to do if these conditions are not met - for example should the program throw an error if the function parameters don't meet the constraints?
My basic tests have passed, and without information about what the random tests contain, I don't know what to "check it" for. Could you provide a little more information please? Perhaps an example of a test case that would definitely fail with my solution? Also what should my solution return if the constraints aren't met? (Isn't that an essential part of the problem definition, BTW?)
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
For a 7 kyu kata, the self-execution function in JS seems overly complex and probably confusing to many people at this level.
Loading more items...