https://www.codewars.com/kata/55f9b48403f6b87a7c0000bd
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:
Your classmates asked you to copy some paperwork for them. You know that there are 'n' classmates and the paperwork has 'm' pages.
Your task is to calculate how many blank pages do you need. If n < 0 or m < 0 return 0.
Example:
n= 5, m=5: 25
n=-5, m=5: 0
Waiting for translations and Feedback! Thanks!
코드
function paperwork(n, m) {
if(n < 0 || m < 0) return 0;
return n * m;
}
'알고리즘 > Codewars' 카테고리의 다른 글
[Codewars] Fake Binary (8 kyu) / JavaScript (0) | 2023.01.19 |
---|---|
[Codewars] Reverse words (7 kyu) / JavaScript (0) | 2023.01.18 |
[Codewars] Invert values (8 kyu) / JavaScript (0) | 2023.01.16 |
[Codewars] Human Readable Time (5 kyu) / JavaScript (0) | 2023.01.15 |
[Codewars] Find the divisors! (7 kyu) / JavaScript (0) | 2023.01.13 |
댓글