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
Adding substance to the above critisizm, in your 'for loop' notice the following:
for i in range(0, 4):
will only check your remaining if, elif, else statements for the index 0 to 3 in arr1, arr2.
for i in range(0, len(arr1)):
will check those statements for the index 0 up to len(arr1) - 1 (this allows the program to scale with a possible change in list size)
We are told the list length will be the same so modifying your program with this new range in your for loop will suffice.
:P
This comment is hidden because it contains spoiler information about the solution
you should see what sagemath can do. I strongly recommend using sagemath as it is python 3 with a huge library of extra modules specifically for applied and abstract mathematics.
lol FFS :P
This avoids having to use (factorial(n - 1) + 1) % (n^2) and bypasses huge divisions other than (factorial(n - 1) + 1)//(n^2) (which can be done before time out on most attempts), everything else is multiplication :P
Still checking if (factorial(n - 1) + 1) % (n^2) == 0 is the best option. Alternately, this shows modulo is not needed with some intuition about the floor of an integer and simple algebra.
lol clean the dojo! i am here doing kata's all night chilling and this post almost made me spit my drink out lolololol
[start:stop(not but not including): step] so str(string)[::-1] gives every character of the string by step -1, thus backwards.
This comment is hidden because it contains spoiler information about the solution
LOL did the same thing :P dat python 3
Exactly what I did :P, the trick was making the last key 0 in the dictionary for the modulo to work for any nb_petals being a multiple of 6 :P
number % a == 0 and number % b == 0 evaluates to True if both are True
number % a == 0 and number % b == 0 evaluates to False if either or both are False
So there is actually a boolean being returned :P