Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

School paperwork

// 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
*/

const paperwork = (n, m) => (m < 0 || n < 0) ? 0 : m * n

// With love @kouqhar
Source by www.codewars.com #
 
PREVIOUS NEXT
Tagged: #School #paperwork
ADD COMMENT
Topic
Name
5+8 =