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.
If you are doing it like i think you are, with big numbers, raising them to a power and multiplying them is not O(1), because they are no longer stored in a 32 or 64 bit integer.
With bounded tests anything is O(1)
Are you sure it's O(1)?
Doesn't sound possible unless you've harcoded all the answers
I have the same problem in Racket.
I can't even see in what test it is failing, it only returns "timedout" without further explanation.
What kind of math is required for solving, and understanding this kata?
My solution in java is O(1), but I am still getting timedout.
You're using a static var that's outside
singlePermutations
. It'll keep its value when it's called more than once. Try doing that and you'll see it anywhere.In my IDE and repl, "ab" gives ["ab", "ba"], but when I ran my code, they said expected ["ab", "ba"], but was ["a", "ab", "ba"].
Please read this: https://github.com/codewars/codewars.com/wiki/Troubleshooting-your-solution#post-discourse
This comment is hidden because it contains spoiler information about the solution