Ad
  • Default User Avatar

    I have a problem with passing a random test. Tell me what values it can give to fix my code in Java.
    Sometimes a random test gets passed and I submitted my code as solved, but I want to understand where my mistake is.

  • Custom User Avatar

    then let's approve this

  • Default User Avatar

    After hitting the "ATTEMPT" button I receive the following error message after successfully completing and "Passing" the first 13,021 Random Tests?

        STDERR
        Max Buffer Size Reached (1.5 MiB)
    

    It appears that the test results output from this kata is exceeding the maximum size of the Codewars output buffer. Is there a reason that you require so many random tests?

  • Custom User Avatar

    If the total attack power of both sides is the same return true.

  • Custom User Avatar

    what happens when the initial damage is also the same?

    e.g.,

    attackers=[1,3,1,1], defenders=[2,4]
    
  • Custom User Avatar
    1. changed to def is_defended(attackers, defenders):
    2. added this fixed test, as you mentioned at end of suggestion.
  • Custom User Avatar

    Current votes on Kata:

    7kyu - 10
    6kyu - 2(including my vote)
    
  • Default User Avatar

    Small suggestions for the Python (maybe other languages also) version:

    1. Since this is rated as 7 kyu, why not make the arguments clearer for users by matching how they appear in the description: def is_defended(attackers, defenders): instead of: def is_defended(at, def_):

    2. There should be a fixed test testing for this: "In case there are the same number of survivors in both sides, the winner is the team with the highest initial attack power. If the total attack power of both sides is the same return true."

    e.g. attackers [10, 10, 1, 1] , defenders [4,4,7,7] -> score is 2:2, total intial attack power both sides is same, 22, so expects True

  • Custom User Avatar

    ok, seems to be fine now

  • Custom User Avatar

    attackers has 4 surviours when defenders also have 4 surviours then we find sum of bots sides: 111 < 112

  • Custom User Avatar
    testing for attackers=[1, 5, 15, 5, 10, 49, 6, 21], defenders=[31, 19, 45, 9, 7]
    Didnt work for attackers=[1, 5, 15, 5, 10, 49, 6, 21], defenders=[31, 19, 45, 9, 7]: True should equal False
    
  • Custom User Avatar

    Fixed, point me if you find errors now

  • Custom User Avatar

    Now it is correct

  • Custom User Avatar

    Are you sure the Python solution is correct?

  • Default User Avatar

    Either I don't understand the Instructions or there are problems with some of your test cases. I am attempting to complete this kata using Python. Here is a list of some of the messages that I received for incorrect answers:

    Didnt work for attackers=[5], defenders=[16, 18, 45, 46, 41, 9, 45, 30]: True should equal False

    Didnt work for attackers=[17], defenders=[24, 12, 22, 19, 39, 18, 5, 22, 7, 43]: True should equal False

    Didnt work for attackers=[43], defenders=[50, 14, 34, 13, 26, 33, 3, 30, 47, 38]: True should equal False

    Didnt work for attackers=[16, 45, 31, 28, 14, 23, 14], defenders=[7, 38, 2, 37, 46, 43, 39, 16, 37, 29]: True should equal False

    Didnt work for attackers=[49, 9, 20, 18, 46], defenders=[27, 23, 38, 40, 4, 27, 14, 8]: True should equal False

    Thanks in advance!

  • Loading more items...