Earn extra honor and gain new allies!
Honor is earned for each new codewarrior who joins.
Learn more
  • Crystal Translation done, please check.

    • your first line (inside the function) clearly isn't doing what you think it does (btw, bin_a has never been defined before so... => !??)
    • and reverse_inplace! isn't a function of the ruby String class, afaik (careful about the language version too: on CW, you're limited to ruby 2.5.0)

    edit: btw, you're not supposed to have an argument to that function (you need to learn a bit more about class/OOP design and how to declare methods in such a kind of situation)

  • You can read about code formatting on CodeWars wiki.

  • I could use some help with this one. I've worked out what I need to do, I just can't seem to make the code work for it for some reason. I keep coming up against the error: wrong number of arguments given, expected 1, received 0.

    Unfortunately I also can't work out how to post my code in the comment boxes either so if someone could also tell me how to do that I can add the code into this.

    Thanks in advance

  • I like this too, but I didn't know you could change the method signature, but your way of doing so was elegant. It effectively side-steps the whole issue.

    • omg, somehow i never thought of declaring the solutions' functions static in my C katas and relied on stupid obfuscation instead. gona change that right away
    • i'm aware that RAND_MAX != UINT_MAX, i'm just using unsigned as a hint for the codewarrior because the description says that integers will always be positive

    thanks to you two :)

  • Thank you so much! after some looking around and testing I was able to get it and I am very surprised at that too. Thanks again!

  • i dont know python but i can say how i started js. learn data structures started by doing simple thing like manipulating an array or object in functions. and start your 8th 7th kyu challenges. i'm still a begginer though so i hope it helps

  • Hey there,
    I'm not sure about the material but I hope the following steps will help you go through this kata.
    You are give an integer or you can say a number in this kata.

    1. Try to figure out how you can - Convert an integer to its binary form in python
    2. Also try figuring out - How to reverse a string/number in python
    3. I am sure after this you will know how to go through the kata.

    P.S - The figuring out part can be as simple as a google search 😉. Make sure you understand the concept and then try attempting the kata or it will be of no use.

  • I am new and needed help. Is there any material that would help me with this task? I use python

  • i will try to create an if statment for 32 bit

  • It fails only this sample test, but will probably fail more test cases from full test suite.
    Yes, your solution has an error.
    Did you try to recreate the test case for Number.MAX_SAFE_INTEGER locally and see how it works and why it might fail?

  • Did you try your solution with Number.MAX_SAFE_INTEGER?

    Your solution fails sample test for Number.MAX_SAFE_INTEGER, or actually for any number lager than 32 bytes.

  • Loading more items...