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.
Hi prince1456,
How did you get it solved with javascript? I've been getting 47 for 0112 with number reverse, string split reverse conversion, and even with iteration using for loop. What do you suggest is the reason for this?
Thanks
I have same problem and im stuck on this but i solved it with javascript lol but ruby oh nooooo
This comment is hidden because it contains spoiler information about the solution
I think you are getting false-positives for the tests saying
Value is not what was expected
. There's a problem in your code that I can see, but I the point of a kata is for the coder to debug their code. So hopefully that helps a little?This comment is hidden because it contains spoiler information about the solution
rlubinsky, your code simply does not work with number==1. And 1 is a proper power of 4 (4**0), that's all :)
Also, I would completely rethink your algo for checking it, but it could work that way too, provided you consider this kind of cases.
Oh and as the creator could pass by: I kumited the Python version; any idea how it works to get it approved? I mean, if it is up to you, it becomes some kind of beta or what.
Could you add a reply with your code, and marked as "spoiler"? It will make it easier to help.
Same problem here but with the JS version
powerOf4
powerOf4 should be defined
Test Passed
should return true for powers of 4
Test Passed
Test Passed
Test Passed
Test Passed
should return false for non powers of 4
Test Passed
Test Passed
Value is not what was expected
Value is not what was expected
Test Passed
Test Passed
Test Passed
should return false for non positive integer inputs
Test Passed
Test Passed
Test Passed
Test Passed
Test Passed
Test Passed
Test Passed
Test Passed
Test Passed
I presume you are using Ruby; care to provide us with your code? And consider the extra tests when submitting also include not integer arguments.