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! This is not a coding problem, it is simply about knowing the algorithm, which I did not.
Yes, this would have saved me a lot of time. All the rest are >=, F is the only one thats just >.
Thanks for the Kata!
I got confused because you say first and last digit when you mean "first (most significant)" and "last (least significant)" digit.
The sample test for python does not work. I replaced expect_equals with assert_equals and it needed an extra space in the answer.
This lead me to believe the submit was broken but it was my code.
Funny how nobody got a vote for best practices. That just indicates how hard it is.
The severs must be getting over loaded. I had to submit my solution a bunch of times before it passed without timing out.
When submitting my solution math.log gave me a domain error
Had to resort to awhile loop instead
This katta is more about find the math trick than programing.
Does anyone have a pointer to the math behind this trick?
The test case supplied does not work
There is a trick test case where no arguments are entered.
1.01 returns 'F'
Please add it to the visiable test cases so users don't spend allot of time figuring it out.
Hope this helps. Also, I'm not familiar with Python and didn't think about numbers greater than
0xffffffff
. At this point I can only change the description and add that Python, Java, Coffeescript, Javascript and Ruby only use 32 bit integers.Mine wasn't passing the fifth test then suddenly is passed.
Try these numbers
print powerof4(1125899906842624)
print powerof4(1125899906842625)
the first is 4**25, the second should return false.
See my solution.
This comment is hidden because it contains spoiler information about the solution