<<<<<<< HEAD Code Wars - Brett Crafton

Well of Ideas - Easy Version

Question

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

Solution by -

My Solution


	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

======= Code Wars - Brett Crafton

Well of Ideas - Easy Version

Question

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

Solution by -

My Solution


	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

>>>>>>> 0e614172debaa009c8d31330edbeb3b765b59c39