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.
Didn't help at all. I wonder, why would it help...
Here's a line of my code to explain what I mean:
As you can see, I need to expand variables, which would not be done if I enclosed my long string in single quotes.
P.S. Finally made my solution work by ending each output line except for the last one with \\n and moving a helper function outside of the main function. Crazy...
Try using single quotes rather than double quotes.
see, I don't know what exactly your problem is but if it is like EOL then remember, ALL YOU HAVE TO DO IS RETURN THE GIVEN INPUT or the input of the function not the input which will be supplied during the program.
That's quite possible. My solution is quite naive, and I did not check all the possible cases.
This solution sometimes fails.
Hi everybody,
For some reason, my PHP solution always fails the test when the input is '9'.
I'm new to PHP, but the lyrics generated by my code look fine. At least, I compared my output with the expected output line by line.
I suspect that something is wrong with my line endings, so I tried different ones: \n, \r\n, PHP_EOL, even < br > (the last one is obviously wrong), but still couldn't pass the test.
Any ideas are welcome.
Cheers.
I agree with you, the description does not describe correctly what users are supposed to do.
I think finding a working solution in the first place is way tougher than a 6 kyu problem. I'm solving 4kyu problems way easier than this one.
I think my problem is that I am finding every possible sum then searching for the lowest number not included in the sums. I need to reverse that order. Start counting at 1 and return false if you can't find a combination of numbers that add up to that number. Kind of fatigued from working on this problem for now though but I will definitely return to it.
Problem solved after a lot of work. :)
For some reason, I can't submit my JavaScript solution after it has passed all of the tests successfully.
P.S. My bad, didn't see that it's "retired."
Now my JavaScript solution successfully runs through most -- but sadly not all -- of the random tests...
Is it possible that some of the random tests are a little bit off the mark? For example, this one:
[[41,65],[60,94],[2,24],[46,47],[70,85],[16,77],[33,86],[54,95],[72,92],[74,94],[69,81],[31,46],[63,100],[69,87],[72,97],[20,54],[71,74],[1,66],[56,72],[54,58],[8,94],[21,58],[6,23],[65,93],[41,61],[77,89],[52,57],[29,54],[68,73],[67,82],[11,63],[35,71],[64,89],[80,97],[38,95]]
Expected: 18, instead got: 17
If anyone is interested, I can provide my console logs indicating that the maximum number of people in the room in that particular case should be 17, not 18.
Beware of spoilers!
P.S. Of course, I might be wrong, but I've already manually double-checked the above-mentioned console logs.
P.P.S. My bad, I've probably misunderstood the problem statement a little bit:
"please note that guest still in the room at 10th minute."
P.P.P.S. Actually it looks like I've second-guessed the problem statement when writing my code, so my offer stays.
For example, here's how much time it takes to run a very simple JavaScript function whose body consists of a single line that only returns a fixed number:
Time: 5392ms Passed: 2 Failed: 103 Exit Code: 1
If I add a few things like finding (but not outputting to the console) the minumum entry time, the maximum entry time, the minumum exit time, and the maximum exit time -- which would not allow me to solve this nontrivial kata but at least could give me some perspective -- the code running time goes up:
Time: 5884ms Passed: 3 Failed: 102 Exit Code: 1
And I have not done anything useful yet...
P.S. Sorry, initially I mentioned Python, but it was actually JavaScript. Sometimes I mix them up. :)
P.P.S. Hopefully, I can solve this kata on my own. But still, I believe 5 kyu is not the most appropriate grade. :)
5 kyu, you must be kidding...
Great advice! As soon as I made a copy of the input array instead of reusing it, it worked like a charm.
Your solution is probably correct. The problem is due to the input being modified on the testing end. See my issue above
Loading more items...