Opposites Attract

Lee·2022년 6월 2일

Algorithm

목록 보기
3/92
post-thumbnail

❓ Opposites Attract

Q. 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.

✔ Solution

const stringToNumber = function(str){
return parseInt(str);
}
let str = "1234";

Check

profile
Lee

0개의 댓글