beyondgrader.com Logo
DemoBrowseAboutTeamLogin

Array Fill 3 Pattern

Geoffrey Challen // 2022.7.0

Complete a method named arrayFill3Pattern that creates int arrays filled with a 3-based pattern. Here are some examples.

Here's a 1x1 example:

1

Here's a 2x3 example:

1 4 7
4 7 10

Here's a 4x2 example:

1 4
4 7
7 10
10 13

And so on.

Your method should accept two int parameters: the number of rows and columns in the array. Both values will be positive. Return a two-dimensional int array with the first index the rows and the second the columns filled with the pattern as shown above.