Ad
  • Custom User Avatar

    Aaa now I understood what you mean. it wasn't stacking in the first test it was stacking in 0 :D. sorry that I have waste your time. and thank you for your help.

  • Custom User Avatar

    i was going to add if statement at the beginning of the code for that. my problem is that i cannot even run program for solving this:

    assertEquals("128.114.17.104", Kata.longToIP(2154959208L)

    So I have changed my solution to more static/brute force method to test.

  • Custom User Avatar

    There's an error in your code. Recreate this test case locally and see how it fails:

    assertEquals("0.0.0.0", Kata.longToIP(0));

  • Custom User Avatar
  • Custom User Avatar

    Sorry I ve never shared my code before in this platform i dont know why it looks so weird

  • Custom User Avatar

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

  • Custom User Avatar

    I tried both, Java 8 and Java 11. If you think your solution is OK and tests are incorrect, you can post your solution here (with spoiler flag!) and we will check it.

  • Custom User Avatar

    Well thank you for your replay but when i printed out my solution it was matching with his answer. I can try to solve it again. which version of java did u use?

  • Custom User Avatar

    There is a problem with String index out of range: when you solve the problem, in Java. There is no problem with String index out of range: when I solve the problem, in Java.

  • Custom User Avatar

    There is a problem with String index out of range: when u solve the problem, in Java