Learn
Exam

Calculate the Sum of Multiplication Table Results

Difficulty
STARTER

Problem

Given two natural numbers start and end, write a function solution that returns the sum of the results of the multiplication tables from start to end. For example, if start = 4 and end = 25, the sum of all the results from the 4th multiplication table to the 25th must be calculated.


Constraints

  • start and end are natural numbers between 1 and 100 inclusive.
  • start is less than or equal to end.
  • Each table is calculated up to the 9th multiplication.

Test Case

Test Case Number start end return
1 4 5 405
2 10 12 1485
3 1 3 270

Explanation for Test Case 1

  • When start = 4 and end = 5, the sum of all the multiplication results for the 4th and 5th tables is 405.

Explanation for Test Case 2

  • When start = 10 and end = 12, the sum of all the multiplication results for the 10th, 11th, and 12th tables is 1485.

Explanation for Test Case 3

  • When start = 1 and end = 3, the sum of all the multiplication results for the 1st, 2nd, and 3rd tables is 270.