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.
Any discrete math course covers sequences. This one in particular is an arithmetic sequence.
I suggest to study discrete math as it often helps to find O(1) solutions to different problems like combinatorics, sequences etc.
You're confusing the input of one test with the error message of another, the log appears above the test result, and the test with that input expects True.
I tried your method first and found out that you just can't use operator as dict values. What you may want to consider is use operator.add instead of
+
. Of course you need to import operator first.This solution is neat, but would take ages to work out the answer if n was very large. Instead you could just use simple maths to calculate the answer rather than count it.
Why would this be a poor solution for n large?
2293ms
If n were large, this would be a very poor solution.
Can't tell without seeing your code, but I have just solved it in Python and worked fine for me.
Your code isn't converting
0
too