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.
to be honest the most part of that algorythm was found on the net. I just modified it a bit to improve the performance. But it's like life , you start from known bases and you improve it ;).
the prob is that you gave code not only definition. That code mislead me because I naively think you wanted we used that code. Perhaps just give only definition and not code or precise that the code you give is not efficient on CW web site (btw that code is perfectively fine on my computer even with very big number)
This comment is hidden because it contains spoiler information about the solution
@hobovsky : when i say i use python 3.8 it was on my computer not on teh web site. I also think you have misunderstood me : I had the timeout message on the 'Test' when you obviously show me the 'Attempt' result.
Test use 17 tests : .
@ecolban : you are a naughty boy. I finally understand where come the message of 'Times out' = that comes from your code to caculate totients (G = {i for i in range(1, m) if gcd(i, m) == 1}). If i used anotehr method all is good
Sadly your tips do not work.
when i return 1 and print the args i have only the test case shown in the "'sample test" (around 16 tests) windows and i have already test tehm with success
%%timeit
tower(3,4,1001)
tower(729, 0, 1)
tower(729, 0, 2)
tower(1, 897, 8934279)
tower(3, 3, 25)
tower(2, 2, 1000)
tower(2, 3, 100000)
tower(2, 4, 100000000)
tower(4, 2, 10000000)
tower(4, 3, 10)
tower(7, 1, 5)
tower(28, 3, 25)
tower(28 % 25, 3, 25)
tower(13, 3, 31)
pow(13, tower(13, 2, 31), 31)
tower(13, 3, 31)
pow(13, tower(13, 2, 30), 31)
tower(13, 3, 31)
pow(13, 30 + tower(13, 2, 30), 31)
m = 1001
t_3_3 = 3 ** 3 ** 3
t_3_4 = pow(3, t_3_3, m)
tower(3, 4, m)
t_2_4 = pow(2, 2 ** 2 ** 2)
t_2_5 = pow(2, t_2_4, 720)
t_2_6 = pow(2, 720 + t_2_5, m)
tower(2, 6, m)
=>
10 µs ± 765 ns per loop (mean ± std. dev. of 7 runs, 1 loop each)
Hi everybody,
I do not understand why I have an "Execution Time Out" when I do the tests on the server since all is fine at home.
I do not use brute force.
when I use the maximum value allowed by the instructions :
tower(int(1e20),int(1e20),10000000)
the result is obtained in 703 ns ± 6.63 ns
When I do all the tests shown in the SampleTests part, the tests are ended in 10 µs ± 765 ns
any idea that can help me solve that Time prob?
I use python 3.8
I m curious about the effect of "code" as a string on a code. Have you an idea?
BTW the "code" comment was in a solution for another calculator kata's solution I submitted and I did ont have a prob at that time.
thanks for all your answers
it was that. It s really strange condition but its not in instruction. I do not understand why writting "code" in a acommetn is forbidden.
so i have no idea where come from that 'You can't use code: ['code'] should equal []'
it s sad since my code passed all the test and attemps except that message
Hi again,
I have an other issue to report.
My code use regular expressions but it s working even if do not import re !!!!!
I try to find where come from the message 'You can't use code: ['code'] should equal []' ?
So i put import re as commentary( #import re). So re is no more imported but strangely all my regular expressions are still working????
I thing something is broken on the code war server.
language = Python
Just to say your code is clever. For mine I have used sklearn so I fill like cheating
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 know that solution is older than 2 month I was talking about answer of people that visibly test the solution with success and so are probably still using python 2 (see answer of Seawolf159 or gsrus.russian.hacker)
yes i know it s due to python 2. But normaly if you fix in doiing a list of the zip that works but here its not the case...
I find also strange that still 2 month ago people are still using python 2...
code wars should obliged to put teh verison of the language used to solve the prob
Loading more items...