Ad
  • Default User Avatar

    @dinglemouse yes, maybe you are right.... but i dont have an authority to check the Junit tests complectely.... and @GiacomoSorbi i cant uderstant what do you mean by "Java translator comment" (do u mean the one who is a JAVA programmer and solved it before?) sorry i am new here.....

  • Default User Avatar

    Because the input number is "1234567890"..... So the next number using the same digits should bE : "1234567908" But insted your code returns "1234567980 which is the second next biggest..... Not the "next" biggest!

    Hope it helps.... :)

  • Default User Avatar

    yes....thats exactly I am wondering...It maybe the fault in that "biggerTest" test in JAVA.
    but.... this KATA has been completed 23 times..... so it might be my fault... but all other test seams perfect...

    it would be great if you could diagnose this issue because i cant find any JAVA related help here.

  • Default User Avatar

    thanks for your reply sir, I am also beginner in JAVA Anywyays So can you please clearify me wheather My tests are correct or not? Not Language a specific question (Running in a local mechine):-

    original Value : 1234567890;
    The next Value using the same digits: 1234567908

    original Value : 1286608618;
    The next Value using the same digits: 1286608681

    original Value : 123456789;
    The next Value using the same digits: 123456798

    If yes... then may i know why i am geting this error:-

    biggerTests(KataTests)
    Log
    123456789
    1234567890
    1286608618
    ✘ expected:<-1> but was:<1286608681>

    and apart from these 3 inputs i have cleared all my test (basic as well as randome ones);

    Thanks again

  • Default User Avatar

    I am using "JAVA"

    Greetings Sir.... First of all thankyou for making another great KATA (I sure am the fan of ur KATAs xD)

    Anyways.... After experiencing painfull hours of finding the solution... i finally did it!

    But i am facing some problem in that BiggerNumber category Test..(I passed all the random and basic test)

    the input is "1286608618" and my algorithem produce == "1286608681" which In my openion is the correct answer.

    But insted it shows me this error: ✘ expected:<-1> but was:<1286608681>

    I didnt know what is going wrong here....

    It would be great if you could guide me to resolve this issue....

    Thankyou for your Time in advance :D

  • Default User Avatar

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

  • Default User Avatar

    Ok sir i got the solution....... i just converted the pre-givin "nb_Dig" to nbDig and it solved everything..... Sorry for bothering you and yeah Thanks again for Making this KATA :D

  • Default User Avatar

    sir, your test is looking for "nbDig" but in the java version of this test its "nb_dig"

    So when I alter the test it works perfectly!

    import static org.junit.Assert.*;

    import org.junit.Test;

    import static org.junit.Assert.assertEquals;

    public class CountDigTest {
    private static void testing(int actual, int expected) {
    assertEquals(expected, actual);
    }
    @Test
    public void test() {
    System.out.println("Fixed Tests nbDig");
    testing(CountDig.nb_dig(5750, 0), 4699);
    testing(CountDig.nb_dig(11011, 2), 9481);
    testing(CountDig.nb_dig(12224, 8), 7733);
    testing(CountDig.nb_dig(11549, 1), 11905);
    }
    }

  • Default User Avatar

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

  • Default User Avatar

    ERROR: /CountDigTest.java:34: error: cannot find symbol
    Log: ......

    it looks like your Test file has errors.....Please fix it......I cant execute my code because of this.