Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

Codewars Beginner Series #3 Sum of Numbers

const getSum = (a, b) => {
    let min = Math.min(a, b),
        max = Math.max(a, b);
    return (max - min + 1) * (min + max) / 2;
}
 
PREVIOUS NEXT
Tagged: #Codewars #Beginner #Series #Sum #Numbers
ADD COMMENT
Topic
Name
6+4 =