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.
when i test code in this platform it doesn't work the same as IDLE
on idle the same code shows correct answer
В целом задача простая главное не забыть вернуться в нужную точку:)
Does this sequence of directions lead you to the same position (starting point)? ;)
Can anyone help me with this test: ['n','n','n','s','n','s','n','s','n','s'] ?
this test in condition true because of len is 10 and it is in 'nswe'
but test requires False for this test ?
but this test before calling has 'not'
but 'not' doesnt work
is it due to a loop that's causing the O(n^2) ?
do i have to make it O(n) ?
You don't have to worry about the size of the input (don't need to test if the length of the list is less than 1M).
The problem is that your solution takes a time that is proportional to the length of the list squared. It means that if the input is 3 times as big, your solution will run 9 (3x3) times longer. The goal of this kata is to find a way to code a solution that takes a time proportional to the length of the argument.
With big words, your solution currently runs in O(n^2) and you have to make it run in O(n).
Таже проблема. В этом то и сложность этого кода.
Нужно максимально его оптимизировать чтоб блина списка в 10**6 могла быстро решится.
Сам думаю над решением ;)
Could you help me with a hint,
i can't pass 'Big size' condition in Attempt
i write code for this condition 'size of S goes up to 10^6'
lenght has to be less then 10^6 but unfortunately it doesnt work
i dont know how to solve this problem
I resolved the problem...the count of 44 was a error.
In Python the error message: X should equal Y means that your code is returning the value X, and the correct answer (expected by the kata) is in fact Y.
If you put
print(n)
at the start of your code (beforecuenta = 1
for example) you will see that the test you are failing is for the input value ofn = 73567465519280238573
. Your code is producing the answer561
for this input, and the correct answer is in fact362
.I have no idea where you get
44
from, since not even your current solution is producing44
so your "test in other program" is very strange.I will give you a small hint for where you are going wrong - add another
print(n)
line just after your coden = n/2
and see if you notice something about the numbers that your code is working with.Hello people!!
In basic tests it says: "561 should equal 362"
shouldn't it be equal to 44? For me, the result is 44 and i test in other progran
Thanks
Your solution has a quite subtle bug.
Your code is wrong, and kata seems to be OK.
561 should equal 362
everything corrects except, these tests.
i've open solution and all solutions dont work with this test... please, fix it
The same problem, yesterday i thought the problem was in my code, today i gave up and saw solution almost the same and tried use solution code to see what the differnce would be, but anyway again the same error showed:
''561 should equal 362''
really guys i dont understand anything, why it shows this error
This means your function returned 561 but the correct answer was 362, for some number (in this case 73567465519280238573). Your code failed on other inputs, it is incorrect.
it's mistake in problem. they must to fix it
Loading more items...