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.
have you used
timeit
to compare the performance of yourCounter()
solution with this one? I personally believe that your solution could be 10X slower.Time complexity is O(n^2), would not consider it as 'best practices' while there are more optimal solutions (e.g. see Counter).
And I was wondering why my code was wrong....
Thanks
Print the input.
Unnecessary, but pythonic -
Explicit is better than implicit
. Many linters would flag this function if you leftreturn None
out (and rightly so)the last line is unnessary here
You should have the factors in the first array, and the number of each in the second
So one 2 and one 5 are written as an array containin the 2 and 5, and a second array containing the number of them; one of each
so it's [[2,5],[1,1]]
why?
I forgot the 8!, now match that expression.
Wouldn't this fail '[8]' test?
When I submit the code, it test the number 10 and the prime factors for 10 are: 2 and 5 but it throw this error
[[1, 5], [1, 2]] should equal [[2, 5], [1, 1]]
I don't understand why
EDIT: sorry, now I understand why
Is there a way to show what numbers fail in the regex pattern?
I tested my regex and 74 expression passed but 8 expression failed, I would like to know what numbers didn't pass the regex. I tested the regex and seems to look ok.