Ad
  • Custom User Avatar

    I improved the random tests and the solution passes now.

  • Default User Avatar

    Ok, sincere apologies, you were correct, I reopened the issue at the top of the page. the tests are indeed using reflection, i dont know why your code is failing

  • Default User Avatar

    okay, i checked your code, you made the same mistake as me initially, rollback() has to support the entire history of versions, not just the last one. i think the description should make this clearer

  • Default User Avatar

    please tag this as a question, not an issue. it is very likely that the error comes from your code, not the tests suite, as 160+ people passed the Java version without complaints. are you making sure that your methods are chainable ?

  • Default User Avatar

    Yes, at least on Ruby. Well, it’s not so difficult, it’s more about attentiveness, the main thing is not to get confused in the code.

  • Default User Avatar

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

  • Custom User Avatar

    That test expects false, not true

     a1 = intArrayOf(121, 144, 19, 161, 19, 144, 19, 11)
     a2 = intArrayOf(11*11, 121*121, 144*144, 190*190, 161*161, 19*19, 144*144, 19*19)
     assertEquals(false, comp(a1, a2))
    

    Kotlin Completions 651

  • Custom User Avatar

    Thanks for the translation.

    My original Java Kata also included a random2 test. Please add that.

      // This method more realistic numbers from the real Pony Express
      // 184 stations
      // distance between them 5-25 miles
      public void random2() {
      ...
    

    Also input/output for all random tests same as the original Java, so that I can review it properly.

  • Default User Avatar

    Thanks for the suggestions, I have incorporated them.