Ad
  • Default User Avatar

    added by someone

  • Default User Avatar

    Agreed. Also, in Go a return type of (int, int) would be more idiomatic than [2]int (although more cumbersome to test)

  • Default User Avatar

    Test4 and last test print the same but these two cases are different. To avoid errors I will suppress my printing so that you can print and see yourself.
    Re-read carefully the description (think of possible edge cases, see the remarks). Be sure that there are no errors in the tests. Cheers.

  • Custom User Avatar

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

  • Default User Avatar

    I totally re-wrote the C++ translation. Maybe you could have a look.

  • Custom User Avatar

    Please add package kata at the beginning of Go training template.

  • Custom User Avatar

    The pown function can cause an overflow exception, e.g:

    pown Int64.MaxValue 2 // => OverflowException
    
    Int64.MaxValue * Int64.MaxValue // => 1
    
  • Default User Avatar
    $a1 = [121, 144, 19, 161, 19, 144, 19, 11];
    $a2 = [11*11, 121*121, 144*144, 19*19, 161*161, 19*19, 144*144, 19*19];
    $this->revTest(comp($a1, $a2), true);
    

    Maybe you don't read correctly the result of the test: the expected result is true and you returned false.

    PS: See the top of the page, 576 guys passed the PHP kata. If there were errors one can hope that somebody would have already seen them!

  • Custom User Avatar

    Found bug in PHP testcase

      $a1=array (  0 => 121,  1 => 144,  2 => 19,  3 => 161,  4 => 19,  5 => 144,  6 => 19,  7 => 11,);
      $a2=array (  0 => 121,  1 => 14641,  2 => 20736,  3 => 361,  4 => 25921,  5 => 361,  6 => 20736,  7 => 361,);
      $this->revTest(comp($a1, $a2), true);
    

    It is true, but in Attemt's testBasics it is expected false - http://prntscr.com/lxt4ma .

    Please, check expected result in this test in Attempt's testBasics.

  • Default User Avatar

    I am sorry but I don't see any problem. Are you sur that is the same tests?

  • Custom User Avatar

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