Loading collection data...
Collections are a way for you to organize kata so that you can create your own training routines. Every collection you create is public and automatically sharable with other warriors. After you have added a few kata to a collection you and others can train on the kata contained within the collection.
Get started now by creating a new collection.
This is how people from india code. Try taking over one of those projects lol.
I agree with you, but it's just not in the "clever" category.
You will want to sort the word first for time complexity sake.
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_ievilP[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..?