[8kyu][array][fundamentals] conditions

https://www.codewars.com/kata/55f9b48403f6b87a7c0000bd

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.
This commit is contained in:
2024-10-03 13:00:35 +03:00
parent 3a964f61f9
commit 11c4e28710
+6
View File
@@ -0,0 +1,6 @@
export function paperwork(n: number, m: number): number {
if (n < 0 || m < 0) return 0;
return n * m;
}
console.log(paperwork(45, 29))