Ad
  • Custom User Avatar

    It works per the description of this kata. All arrays given are made up of the same number except for one entry. {1,1,1,2,3,3,3,3,3,3,3,1} wouldn't be given as an input.

  • Custom User Avatar

    it does not work correct. If we have {1, 1, 1, 2, 3, 3, 3, 3, 3, 3, 3, 1, 1} the answer is 2.0, your code will return 3.0

  • Custom User Avatar
  • Custom User Avatar

    Based on the below conversations with the author, I guess you should shuffle (=randomize) the input array (a, b, c) for the tests, so that the solution has to sort them first.

  • Custom User Avatar

    Then I provided a translation to C++.
    https://www.codewars.com/kumite/59535205f58e83b3db000081

    Thanks.

  • Custom User Avatar

    thanks a lot for all the work you've done on this kata.
    I'll try to make my katas better next time

  • Custom User Avatar

    No C++ translation is available, so issue is resolved.

  • Custom User Avatar

    can you please mark this as resolved :P, atleast until someone translates it to c++
    thanks.

  • Custom User Avatar

    many of them are not in order.
    ex: [50, 19, 19], [44, 17, 15], [4, 54, 5], [33, 11, 24], [69, 11, 15], [77, 12, 27], [35, 39, 13], [90, 44, 18], [31, 8,22], [22, 30, 7], [94, 16, 25], [84, 37, 18], [84, 19, 23], [9, 45, 21], [61, 18, 9], [93, 50, 25], [10, 21, 17], [65, 26, 3], [39, 31, 6] ]

    as for the description, it says
    Note: c will always be the largest value in the array, whereas a and b can be either of the 2 remaining values.

  • Custom User Avatar

    Further ex. arrays (from python):

    [3, 4, 5], [5, 12, 13], [6, 8, 10], [7, 24, 25], ...
    

    In sorted order.

    And yes, I mean to pass e.g. [3, 5, 4] instead of [3, 4, 5]. But then the java version should be also updated, along with the description that currently says:

    Note: c will always be the largest value in the array...

    Cheers

  • Custom User Avatar

    ex arrays:
    [69, 11, 15], [77, 12, 27],[12, 16, 20]

  • Custom User Avatar

    what do you mean by random order. do you mean that the a,b, and c in the array are in order from smallest to largest?
    If this is what you mean, then yes, it is in a random order.

  • Custom User Avatar

    The python version can be easily updated to provide the integers in random order (just shuffle the array before passing it on).

    I can't help with java, unfortunately (but it looks messy, too...)

  • Custom User Avatar

    I'll try to. Although I don't understand why a c++ variant was automatically included, since I didn't ask the webite to.
    In fact I don't even use c++ >.>

  • Custom User Avatar

    the numbers were in random order when I wrote the kata, but someone edited it out.
    I have now updated the instructions.

  • Loading more items...