Ad
  • Default User Avatar

    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

  • Custom User Avatar

    I have same problem and im stuck on this but i solved it with javascript lol but ruby oh nooooo

  • Custom User Avatar

    This comment is hidden because it contains spoiler information about the solution

  • Custom User Avatar

    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?

  • Custom User Avatar

    This comment is hidden because it contains spoiler information about the solution

  • Custom User Avatar

    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.

  • Custom User Avatar

    Could you add a reply with your code, and marked as "spoiler"? It will make it easier to help.

  • Custom User Avatar

    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

  • Custom User Avatar

    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.