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.
Thank you for the commitment.
I think 5+5 tests are enough. The main idea of the cata is not to allow writing simple solution. And it needs to randomize test cases to prevent predicting test valus. You know, lots of katas can be solved like:
And it's not good
i think it's enough:)
I've just changed the description of the kata. What do you think, it's better?
Kata was moved from Beta status to public, so at least it means the kata is correct. I did not want to write easy kata that could be solved by using easy alghoritm or just monkey code. It's a bit hard kata and hidden tests are using extremely big numbers so you solution must be very efficient. The numbers in tests are randomized and you cab see them if you add "puts number" in your solution. For example, there can be number like 35184372088832, so you solution shoul be enough efficient.
What is about your first point: i even don't know what could be wrong with description if there are even examples of usage:
power_of_two?(4096) # true
power_of_two?(333) # false
You are resourceful:) Thank you for the note, but unfortunately Test Cases are locked and i can not edit them anymore:( It probably happened when the kata was moved from Beta to "Production".
'2' is a power of '2' where the exponent is '1'
There are a few ways to get know if a number is power of two. And all of them will work quickly with small numbers. But the hidden test cases(which you run by pressing 'submit' buttom) use very big numbers. And some alghoritms will be able to deal with very big numbers for a short time. Yes, it's a kind of joke why i didn't show all values in public test cases:)
The timeout happens because of test cases use very big numbers, and not all solutions can be good.
Sorry for the long time response, i was away.
I know that my english is not good.
Could you please write correct english description? I will be happy to write better description.
Maybe. It's interesting: if i change testcases and republish this kata, will it remove progress and existing solutions?