[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.main
parent
3a964f61f9
commit
11c4e28710
@ -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))
|
||||
Loading…
Reference in New Issue