Ad
  • Custom User Avatar

    This is how people from india code. Try taking over one of those projects lol.

  • Custom User Avatar

    I agree with you, but it's just not in the "clever" category.

  • Custom User Avatar

    You will want to sort the word first for time complexity sake.

  • Custom User Avatar

    def goodVsEvil(good, evil)
    goodArr = good.split(" ")
    evilArr = evil.split(" ")
    evilP, goodP, evilPoints, goodPoints = [1,2,2,2,3,5,10], [1,2,3,3,4,10], 0,0
    goodArr.each_with_index.map { |val, idx| goodPoints = goodPoints.to_i + val.to_igoodP[idx].to_i }
    evilArr.each_with_index.map { |val, idx| evilPoints = evilPoints.to_i + val.to_i
    evilP[idx].to_i }
    return 'Battle Result: Good triumphs over Evil' if evilPoints < goodPoints
    return 'Battle Result: Evil triumphs over Good' if goodPoints < evilPoints
    return 'Battle Result: No victor on this battle field' if goodPoints == evilPoints
    end

    Why does this not work..??? I have 63tests past, but my last one was unsuccesful..?