https://www.codewars.com/kata/555086d53eac039a2a000083
Codewars - Achieve mastery through coding practice and developer mentorship
A coding practice website for all programming levels – Join a community of over 3 million developers and improve your coding skills in over 55 programming languages!
www.codewars.com
DESCRIPTION:
Timmy & Sarah think they are in love, but around where they live, they will only know once they pick a flower each. If one of the flowers has an even number of petals and the other has an odd number of petals it means they are in love.
Write a function that will take the number of petals of each flower and return true if they are in love and false if they aren't.
코드
function lovefunc(flower1, flower2){
return flower1 % 2 !== flower2 % 2;
}
'알고리즘 > Codewars' 카테고리의 다른 글
[Codewars] Human Readable Time (5 kyu) / JavaScript (0) | 2023.01.15 |
---|---|
[Codewars] Find the divisors! (7 kyu) / JavaScript (0) | 2023.01.13 |
[Codewars] Sort the odd (6 kyu) / JavaScript (0) | 2023.01.11 |
[Codewars] Odd or Even? (7 kyu) / JavaScript (0) | 2023.01.10 |
[Codewars] Valid Parentheses (5 kyu) / JavaScript (0) | 2023.01.09 |
댓글