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.
bro, it's not about the algorithm, take a closer look at the test numbers about -1, and you will understand what the point is)
Heap while a good idea, is going to take too long, there is a faster approach, that wouldn't require making all the permutations.
I don't get how this is possible, I'm using Heap's algorithm and I'm still getting time limit exceeded
Can you please give a hint? Probably I totaly forgot algebra, I don't understand how to solve it in the math way...
Good kata, I took advice from a comment below and did the math on paper, then the implementation was trivial.
Are you not freeing a pointer that you allocated? I had this issue on another problem when I was starting out, and freeing the allocated variable fixed my issue.
Oh no, you actually had to implement something yourself and use your brain a little bit? Boohoo lol
You are right, this does not handle all possibilities correctly.