You need to sign in or sign up before continuing.×
Retired
Recursive Multiplication Table (retired)
Description:
Let's create a multiplication table using recursion! Our function will get two arguments:
- The first number of the multiplication table
- How many rows we want
Each row will be 8 numbers long and have the input number first, with each number after it multiplied by two. For example, if our first argument is 10:
[[10, 20, 40, 80, 160, 320, 640, 1280]]
Then, the next row will start with the first number of the last row + 1. For example, the first arg (starting num) is 10 and second (num of rows) is 3:
[[10, 20, 40, 80, 160, 320, 640, 1280],
[11, 22, 44, 88, 176, 352, 704, 1408],
[12, 24, 48, 96, 192, 384, 768, 1536]]
The function should return a 2D array with each row represented as an array, as depicted above. Remember to try this with recursion!!
Fundamentals
Recursion
Algorithms
Computability Theory
Logic
Theoretical Computer Science
Arithmetic
Mathematics
Numbers
Tables
Data Structures
Similar Kata:
Stats:
Created | Nov 28, 2017 |
Warriors Trained | 23 |
Total Skips | 0 |
Total Code Submissions | 44 |
Total Times Completed | 7 |
JavaScript Completions | 7 |
Total Stars | 0 |
% of votes with a positive feedback rating | 38% of 4 |
Total "Very Satisfied" Votes | 0 |
Total "Somewhat Satisfied" Votes | 3 |
Total "Not Satisfied" Votes | 1 |
Total Rank Assessments | 4 |
Average Assessed Rank | 7 kyu |
Highest Assessed Rank | 7 kyu |
Lowest Assessed Rank | 8 kyu |