3x3 table
Input
build_multiplication_table(3, 3)
Output
[[1, 2, 3], [2, 4, 6], [3, 6, 9]]
Rows and columns are 1-based. Row 2 column 3 = 2 * 3 = 6.
Full lesson preview
Generate a rows x cols multiplication table (1-based indices) as a list of lists.
Problem statement
Task
Examples
Input
build_multiplication_table(3, 3)
Output
[[1, 2, 3], [2, 4, 6], [3, 6, 9]]
Rows and columns are 1-based. Row 2 column 3 = 2 * 3 = 6.
Input format
Output format
Constraints
Samples
Input
build_multiplication_table(1, 4)
Output
[[1, 2, 3, 4]]
Single row with columns 1..4.