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
startandendare natural numbers between 1 and 100 inclusive.startis less than or equal toend.- 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 = 4andend = 5, the sum of all the multiplication results for the 4th and 5th tables is405.
Explanation for Test Case 2
- When
start = 10andend = 12, the sum of all the multiplication results for the 10th, 11th, and 12th tables is1485.
Explanation for Test Case 3
- When
start = 1andend = 3, the sum of all the multiplication results for the 1st, 2nd, and 3rd tables is270.