Traceback (most recent call last):
File "main.py", line 3, in
import codewars_test as test
ModuleNotFoundError: No module named 'codewars_test'
One might run those tests anyway by commenting out the second line : import codewars_test as test
But then again, when trying to attemt the tests :
Traceback (most recent call last):
File "main.py", line 3, in
import codewars_test as test
ModuleNotFoundError: No module named 'codewars_test'
The problem description is NOT totally correct. it's not how many rats died. We have a total of 10 rats. That's it. These rats are put on position numbered from 0 to 9, so total 10 rats.
1000 bottles of wine are also numbered from 0 to 999. Then each bottle of wine is polled into the glasses in front of the rats according to the binary representation of the bottle number, that is: if the bottle number has bit 1 for position i (0<=i<=9), then poll wine into the glass of that position.
The numbers we received should be the position number of the rats.
No, you need to return one dimensional array, and in such array position of a queen is for each x in (0 ... size), queen[x] = (x, returned_array[x]). So, for example, if you return array [1, 3, 0, 2], it means that there are 4 queens at coordinates:
[0, 1],
[1, 3],
[2, 0],
[3, 2]
Since in this problem each queen position has different x, we do not have to return it explicitly because it can be expressed as index in returned_array.
Is it clearer now? Maybe I should add such example to the description.
Thank you for your quick response :)
Pick py version 3.8
Unable to run the sample tests :
Traceback (most recent call last):
File "main.py", line 3, in
import codewars_test as test
ModuleNotFoundError: No module named 'codewars_test'
One might run those tests anyway by commenting out the second line :
import codewars_test as test
But then again, when trying to attemt the tests :
Traceback (most recent call last):
File "main.py", line 3, in
import codewars_test as test
ModuleNotFoundError: No module named 'codewars_test'
Considering the author never properly enforced any performance requirements, I've removed the pseudo-big tests.
The problem description is NOT totally correct. it's not how many rats died. We have a total of 10 rats. That's it. These rats are put on position numbered from 0 to 9, so total 10 rats.
1000 bottles of wine are also numbered from 0 to 999. Then each bottle of wine is polled into the glasses in front of the rats according to the binary representation of the bottle number, that is: if the bottle number has bit 1 for position i (0<=i<=9), then poll wine into the glass of that position.
The numbers we received should be the position number of the rats.
bad test examples for squares. works only for a square of 2 units, where area and perimeter equal 4. You just ignore units and units^2.
oh ok i'm kinda new here thanks (:
It takes an advantage of poorly written tests
how does that even work
I added the example. Is it clearer now?
Yes, pls: add the ouput example to the instructions. That would be helpful.
This comment is hidden because it contains spoiler information about the solution
No, you need to return one dimensional array, and in such array position of a queen is
for each x in (0 ... size), queen[x] = (x, returned_array[x])
. So, for example, if you return array[1, 3, 0, 2]
, it means that there are 4 queens at coordinates:Since in this problem each queen position has different
x
, we do not have to return it explicitly because it can be expressed as index inreturned_array
.Is it clearer now? Maybe I should add such example to the description.
This comment is hidden because it contains spoiler information about the solution
But o why ???
It feels like it requires code to write this code.
Loading more items...