Ad
  • Default User Avatar

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

  • 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?

  • Default User Avatar

    yes javascript doesn't pass. it should pass.