fix: Formatting for Zig Zag Matrix challenge (#35403)

* fix: Formatting for Zig Zag Matrix challenge

* Remove non-breaking spaces and replace them with normal spaces

* Update zig-zag-matrix.english.md

* Move instructions to instructions section from description

* Update zig-zag-matrix.english.md
pull/33514/head^2
The Coding Aviator 2019-03-05 11:57:57 +05:30 committed by Aditya
parent 8bac073687
commit 081284c2d3
1 changed files with 11 additions and 15 deletions

View File

@ -6,11 +6,9 @@ challengeType: 5
## Description
<section id='description'>
A &nbsp; ''zig-zag'' &nbsp; array is a square arrangement of the first &nbsp;
$N^2$ &nbsp; integers, &nbsp; where the
numbers increase sequentially as you zig-zag along the array's &nbsp;
<a href="https://en.wiktionary.org/wiki/antidiagonal">anti-diagonals</a>.
For example, given &nbsp; '''5''', &nbsp; produce this array:
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 <a href="https://en.wiktionary.org/wiki/antidiagonal">anti-diagonals</a>.
For example, for the input <code>5</code>, the following result should be produced:
<pre>
0 1 5 6 14
2 4 7 13 15
@ -18,13 +16,11 @@ For example, given &nbsp; '''5''', &nbsp; produce this array:
9 11 17 20 22
10 18 19 23 24
</pre>
Write a function that takes the size of the zig-zag matrix, and returns the
corresponding matrix as two-dimensional array.
</section>
## Instructions
<section id='instructions'>
Write a function that takes the size of the zig-zag matrix, and returns the corresponding matrix as two-dimensional array.
</section>
## Tests
@ -33,17 +29,17 @@ corresponding matrix as two-dimensional array.
```yml
tests:
- text: ZigZagMatrix must be a function
testString: assert.equal(typeof ZigZagMatrix, 'function', 'ZigZagMatrix must be a function');
testString: assert.equal(typeof ZigZagMatrix, 'function');
- text: ZigZagMatrix should return array
testString: assert.equal(typeof ZigZagMatrix(1), 'object', 'ZigZagMatrix should return array');
- text: ZigZagMatrix should return an array of nestes arrays
testString: assert.equal(typeof ZigZagMatrix(1)[0], 'object', 'ZigZagMatrix should return an array of nestes arrays');
testString: assert.equal(typeof ZigZagMatrix(1), 'object');
- text: ZigZagMatrix should return an array of nested arrays
testString: assert.equal(typeof ZigZagMatrix(1)[0], 'object');
- text: ZigZagMatrix(1) should return [[0]]
testString: assert.deepEqual(ZigZagMatrix(1), zm1, 'ZigZagMatrix(1) should return [[0]]');
testString: assert.deepEqual(ZigZagMatrix(1), zm1);
- text: ZigZagMatrix(2) should return [[0, 1], [2, 3]]
testString: assert.deepEqual(ZigZagMatrix(2), zm2, 'ZigZagMatrix(2) should return [[0, 1], [2, 3]]');
testString: assert.deepEqual(ZigZagMatrix(2), zm2);
- text: ZigZagMatrix(5) must return specified matrix
testString: assert.deepEqual(ZigZagMatrix(5), zm5, 'ZigZagMatrix(5) must return specified matrix');
testString: assert.deepEqual(ZigZagMatrix(5), zm5);
```