712. Print Multiplication Table Using Recursion

EasyRecursionRecursion

Given an integer n, return its multiplication table from 1 to 10 as a single string of values separated by single spaces. That is, return n*1 n*2 ... n*10. You must build the result recursively without using any loops.

Input: A single integer n.

Output: Return a string of 10 integers separated by single spaces.

Examples

Example 1
Input: 5
Output: 5 10 15 20 25 30 35 40 45 50
Explanation: 5 multiplied by 1..10.
Example 2
Input: 1
Output: 1 2 3 4 5 6 7 8 9 10
Explanation: Identity row.
Example 3
Input: 0
Output: 0 0 0 0 0 0 0 0 0 0
Explanation: All entries are zero.

Constraints

Asked by

TCSInfosysWiproCognizantCapgemini
Solve this problem in the editor →