Ad
  • Default User Avatar

    can't bookmark this kata. got this one 'Access-Control-Allow-Origin'.

  • Custom User Avatar

    You seem to be wrong...
    here is a breakdown:

    Hobbits - 1
    Men - 2
    Elves - 3
    Dwarves - 3
    Eagles - 4
    Wizards - 10
    
    
    Orcs - 1
    Men - 2
    Wargs - 2
    Goblins - 2
    Uruk Hai - 3
    Trolls - 5
    Wizards - 10
    

    The Test case:

               Good             Evil
    team:  [0 0 0 1 0 0 ]   [0 0 0 0 1 0 0 ]
    worth: [1 2 3 3 4 10]   [1 2 2 2 3 5 10]
                 3        -        3
                 0        =        0
    

    It is deffinitely a tie...

  • Default User Avatar
    function goodVsEvil(good, evil) {
        let good_size = good.split(' ').reduce((a, b) => a + (Number(b)), 0);
        let evil_size = evil.split(' ').reduce((a, b) => a + (Number(b)), 0);
    
        if(good_size > evil_size){
            return "Battle Result: Good triumphs over Evil";
        }else if(good_size < evil_size){
            return "Battle Result: Evil eradicates all trace of Good";
        } else if(good_size === evil_size) {
            return "Battle Result: No victor on this battle field";
        }
    }
    

    Please take a look. I think it should pass. but I got 'Should be tie' as error. Am I wrong?

  • Custom User Avatar

    When logging an issue, you need to supply more information because an issue cannot be resolved if no one know what you're talking about. Please supply your solution and the reason why you've raised the issue and mark it as a spoiler,

    Thanks :)

  • Default User Avatar

    yes javascript doesn't pass. it should pass.