FunctionRacerProblemsRace

Multiplication Table

MediumNumPyPython

Return an n x n array where the cell in row i and column j (counting from 0) is (i + 1) * (j + 1). So the first row is 1, 2, 3, ... and the first column is also 1, 2, 3, ... Use broadcasting instead of loops.

Example 1

n 3
returns [[1,2,3],[2,4,6],[3,6,9]]

The rows are [1, 2, 3], [2, 4, 6] and [3, 6, 9].

Constraints

Race itor take your time

Write it in your browser, against the clock. The model solution, stepped through line by line, comes after.

More NumPy problems