HEAD
For every good kata idea there seem to be quite a few bad ones! In this kata you need to check the provided array (x) for good ideas 'good' and bad ideas 'bad'. If there are one or two good ideas, return 'Publish!', if there are more than 2 return 'I smell a series!'. If there are no good ideas, as is often the case, return 'Fail!'.
No examples
function well(x){
let sortedx = x.sort().reverse()
if(sortedx[0] == 'good' && sortedx[1] == 'good' && sortedx[2] == 'good'){
return "I smell a series!"
}
else if(sortedx[0] == 'good' && sortedx[1] == 'good'){
return "Publish!"
}
else if(sortedx[0] == 'good'){
return "Publish!"
}
else{
return "Fail!"
}
}
Try it yourself - CodeWars
For every good kata idea there seem to be quite a few bad ones! In this kata you need to check the provided array (x) for good ideas 'good' and bad ideas 'bad'. If there are one or two good ideas, return 'Publish!', if there are more than 2 return 'I smell a series!'. If there are no good ideas, as is often the case, return 'Fail!'.
No examples
function well(x){
let sortedx = x.sort().reverse()
if(sortedx[0] == 'good' && sortedx[1] == 'good' && sortedx[2] == 'good'){
return "I smell a series!"
}
else if(sortedx[0] == 'good' && sortedx[1] == 'good'){
return "Publish!"
}
else if(sortedx[0] == 'good'){
return "Publish!"
}
else{
return "Fail!"
}
}
Try it yourself - CodeWars