chore(i8n,learn): processed translations
This commit is contained in:
committed by
Mrugesh Mohapatra
parent
15047f2d90
commit
e5c44a3ae5
@ -1,58 +1,62 @@
|
||||
---
|
||||
id: 594810f028c0303b75339ad8
|
||||
title: 之字形矩阵
|
||||
title: Zig-zag matrix
|
||||
challengeType: 5
|
||||
videoUrl: ''
|
||||
forumTopicId: 302348
|
||||
dashedName: zig-zag-matrix
|
||||
---
|
||||
|
||||
# --description--
|
||||
|
||||
“zig-zag”数组是第一个$ N ^ 2 $整数的正方形排列,当数组沿着数组的[反对角线](https://en.wiktionary.org/wiki/antidiagonal)曲折时,数字会逐渐增加。例如,给定“'5”',产生这个数组:
|
||||
A 'zig-zag' array is a square arrangement of the first $N^2$ integers, where the numbers increase sequentially as you zig-zag along the array's [anti-diagonals](https://en.wiktionary.org/wiki/antidiagonal).
|
||||
|
||||
```
|
||||
0 1 5 6 14
|
||||
2 4 7 13 15
|
||||
3 8 12 16 21
|
||||
9 11 17 20 22
|
||||
For example, for the input `5`, the following result should be produced:
|
||||
|
||||
<pre>
|
||||
0 1 5 6 14
|
||||
2 4 7 13 15
|
||||
3 8 12 16 21
|
||||
9 11 17 20 22
|
||||
10 18 19 23 24
|
||||
```
|
||||
</pre>
|
||||
|
||||
编写一个采用Z字形矩阵大小的函数,并将相应的矩阵作为二维数组返回。
|
||||
# --instructions--
|
||||
|
||||
Write a function that takes the size of the zig-zag matrix, and returns the corresponding matrix as two-dimensional array.
|
||||
|
||||
# --hints--
|
||||
|
||||
ZigZagMatrix必须是一个功能
|
||||
ZigZagMatrix should be a function.
|
||||
|
||||
```js
|
||||
assert.equal(typeof ZigZagMatrix, 'function');
|
||||
```
|
||||
|
||||
ZigZagMatrix应该返回数组
|
||||
ZigZagMatrix should return array.
|
||||
|
||||
```js
|
||||
assert.equal(typeof ZigZagMatrix(1), 'object');
|
||||
```
|
||||
|
||||
ZigZagMatrix应该返回一个nestes数组的数组
|
||||
ZigZagMatrix should return an array of nested arrays.
|
||||
|
||||
```js
|
||||
assert.equal(typeof ZigZagMatrix(1)[0], 'object');
|
||||
```
|
||||
|
||||
ZigZagMatrix(1)应返回\[[0]]
|
||||
ZigZagMatrix(1) should return \[[0]].
|
||||
|
||||
```js
|
||||
assert.deepEqual(ZigZagMatrix(1), zm1);
|
||||
```
|
||||
|
||||
ZigZagMatrix(2)应返回\[[0,1],[2,3]]
|
||||
ZigZagMatrix(2) should return \[[0, 1], [2, 3]].
|
||||
|
||||
```js
|
||||
assert.deepEqual(ZigZagMatrix(2), zm2);
|
||||
```
|
||||
|
||||
ZigZagMatrix(5)必须返回指定的矩阵
|
||||
ZigZagMatrix(5) should return specified matrix.
|
||||
|
||||
```js
|
||||
assert.deepEqual(ZigZagMatrix(5), zm5);
|
||||
|
Reference in New Issue
Block a user