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.
This comment is hidden because it contains spoiler information about the solution
[],
[0, 0, 0, 6],
[],
[],
[],
[6, 6, 0, 0, 0, 6],
[]
I need your help:) Looking at the instructions on this "testTrickyQueues" input I understand (and this is what my code does) is that:
From the bottom, the first "passenger" in queue seeks to go down - thus the Direction of the Lift is set to DOWN.
Since there is someone on the 5th floor (3 "passengers" actually) who also seek to go down, lift should me smart enough to regonize this and:
firstly go to floor 5, pick 3 "passengers" than on the way down on the floor 1 collect 2 additonal "passengers" and let 5 pepole out on the ground floor.
So now the queues on each floor look like this:
[],
[0, 6],
[],
[],
[],
[6, 6, 6],
[]
With this logic, the output is at this stage is:
[0, 5, 1, 0] and there are still "passengers" awaiting.
I'm failing 2 from 16 tests, one of them is "testTrickyQueues" and it says that:
arrays first differed at element [1]; expected:<1> but was:<5>
Meaning that we should ignore the fact that on the 5th floor three pepole are willing to go down and pick up the passengers from floor 1.
Which doesn't make sense considering the instructions but I MIGHT simply misread them
Hey g964, thanks for comming back :) Yeah, I just realized I was reading this incorectly;P my bad
Since it's expected to raise the elements of the array/list (the base) to the power equal to the base itself, as shown here:
"solve([2, 1, 3, 4]) returns [2, 11] :
(22 + 11) * (33 + 44) = 5 * 25 = 125 and 2 * 2 + 11 * 11 = 125"
then,
shouldn't this:
"P = (x(1) ** 2 + x(2) ** 2) * (x(3) ** 2 + x(4) ** 2) * ... * (x(m) ** 2 + x(m+1) ** 2)"
be this:
"P = (x(1) ** x(1) + x(2) ** x(2)) * (x(3) ** x(3) + x(4) ** x(4)) * ... * (x(m) ** x(m) + x(m+1) ** x(m+1))"
?
Would anyone be able to help:)? I'm getting errors saying that I'm not returing anything. Well, it's not the task to return, but to call the count() method with the correct parameter which I do ;|
Is the implementation of counter() method taking care of returing the i? My code is running properly on my local machine (where I've implemented a simple Counter class with counter() and a println) but when I migrate the countInThreads logic to this kata it fails. I wonder what's the implementation of Counter class here
This is a really nice Kata:) Thank you. The only thing which strikes me is that the 'Battleship field validator II' kata is like 2-3 times harder to solve but it's the same kyu level
Java!
There is an issue with the randomTests.
I.e. I'm getting "expected:< true> but was:< false>" for"
{1, 1, 1, 0, 0, 0, 0, 0, 0, 0},
{1, 1, 1, 0, 0, 0, 0, 1, 0, 0},
{1, 0, 1, 1, 1, 0, 0, 0, 0, 0},
{0, 0, 0, 1, 1, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
{0, 0, 0, 1, 1, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
{0, 0, 1, 0, 0, 1, 0, 0, 0, 0},
{0, 0, 0, 0, 1, 1, 0, 0, 0, 0},
{0, 0, 0, 0, 1, 0, 0, 0, 0, 0}
But there is no battleship and it should return false.
It's the only test which is failing in my solution, and the only one which seems to be off.
This comment is hidden because it contains spoiler information about the solution
I made it finally!!! <3
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
I'm getting the same error.
Love it! Thanks for creating this Kata
Loading more items...