Ad
  • Custom User Avatar

    Kata hint != kata suggestion. See https://docs.codewars.com/training/troubleshooting#post-discourse.

    Also, this is a 5 kyu kata. Users should know how to efficiently compute fibonacci numbers at this level, and if they don't, they should be able to research how to by themselves.

  • Custom User Avatar

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

  • Custom User Avatar

    fixed. your solution fails both the random and fixed tests consistently now

  • Custom User Avatar

    your solution writes past the end of the output buffer: you are printing a trailing '.', and then erase it. this is not robust: the worst-case output size is 16 i.e. strlen("100.100.100.100") + 1, so the caller of the function can expect that 16 bytes should be enough, but your solution needs more bytes than that. as a result of writing out-of-bounds, you corrupt the tests suite

  • Custom User Avatar

    it is your code that is wrong: you are adding trailing zeroes instead of leading zeroes to the binary string. please ask a question in the future instead of raising an issue ;-)

  • Custom User Avatar

    no, the problem comes from your code. you are assuming that the binary string you create is always 32 chars long, this is not true.

    Please ask a question (not an issue) to ask for help in the future ;-)

  • Custom User Avatar

    Is it possible to implement this in Kotlin? When attempting a logical AND operation, garbage is returned. When I look at the code that compiles in Java, there is a completely wrong idea.
    UPD:Implemented via string. But the test fails. Error with ip: 89.118.64.172.
    In 10th representation it is 1500922028.
    In the 2nd representation - 10110010111011001000000101011000. The first 8 bits 10110010 = 178. Am I missing something or is there an error in the tests?

  • Custom User Avatar

    If you were able to write a “slow” version, look at the output of numbers and the operation of the algorithm, look for a pattern.