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.
Great Kata. However, this kata should definitely be a 7-KYU not a 8-KYU.
Clever solution. Well done!
This comment is hidden because it contains spoiler information about the solution
This is a clever solution!
I love how simple this solution is!
My first attemp was similar to this solution then I realized that a nested loop isn't really needed here
This solution is absolutely brilliant!
Briliant solution!
This is a clever solution. Simple and easy to understand!
I overcomplicated this problem. Your solution is briliant!
Thank you for the great Kata! I learned a lot about regular expressions and their use cases.
this is indeed a great and funny Kata lol
Thw way I understand this is that if-else statements only add a constant factor to the time complexity. In this case, we only have if-else statements and we only need a single operation to return the factorial. We don't do comparisons in order from 1-12 to find the factorial of a given n.
I could argue that this algorithm has a tight-bound theta(1). Obviously you could argue that it has O(n) upper-bound, but who cares about upper-bounds when we have tight-bounds.
I'm sorry I don't understand how is this solution O(n). Could you explain?
Honestly this is a clever O(1) solution consedring a very small range of numbers. Obviusly it won't work for numbers greater than 12 or numbers below 0. However, The problem mentioned that the range will always be 0-12 so nice work lol.
Loading more items...