feat: add styles for markdown tables and convert some HTML tables to markdown (#38126)
This commit is contained in:
committed by
GitHub
parent
afd467f5dc
commit
4ef445c543
@ -7,12 +7,31 @@ forumTopicId: 301617
|
||||
|
||||
## Description
|
||||
<section id='description'>
|
||||
Given an array <code>arr</code>, find element pairs whose sum equal the second argument <code>arg</code> and return the sum of their indices.
|
||||
You may use multiple pairs that have the same numeric elements but different indices. Each pair should use the lowest possible available indices. Once an element has been used it cannot be reused to pair with another element. For instance, <code>pairwise([1, 1, 2], 3)</code> creates a pair <code>[2, 1]</code> using the 1 at index 0 rather than the 1 at index 1, because 0+2 < 1+2.
|
||||
For example <code>pairwise([7, 9, 11, 13, 15], 20)</code> returns <code>6</code>. The pairs that sum to 20 are <code>[7, 13]</code> and <code>[9, 11]</code>. We can then write out the array with their indices and values.
|
||||
<table class="table"><tr><th><strong>Index</strong></th><th>0</th><th>1</th><th>2</th><th>3</th><th>4</th></tr><tr><td>Value</td><td>7</td><td>9</td><td>11</td><td>13</td><td>15</td></tr></table>
|
||||
|
||||
Given an array `arr`, find element pairs whose sum equal the second argument `arg` and return the sum of their indices.
|
||||
|
||||
You may use multiple pairs that have the same numeric elements but different indices. Each pair should use the lowest possible available indices. Once an element has been used it cannot be reused to pair with another element. For instance, `pairwise([1, 1, 2], 3)` creates a pair `[2, 1]` using the 1 at index 0 rather than the 1 at index 1, because 0+2 < 1+2.
|
||||
|
||||
For example `pairwise([7, 9, 11, 13, 15], 20)` returns `6`. The pairs that sum to 20 are `[7, 13]` and `[9, 11]`. We can then write out the array with their indices and values.
|
||||
|
||||
<div style='margin-left: 2em;'>
|
||||
|
||||
|Index|0|1|2|3|4|
|
||||
|--- |--- |--- |--- |--- |--- |
|
||||
|Value|7|9|11|13|15|
|
||||
|
||||
</div>
|
||||
|
||||
Below we'll take their corresponding indices and add them.
|
||||
7 + 13 = 20 → Indices 0 + 3 = 3<br>9 + 11 = 20 → Indices 1 + 2 = 3<br>3 + 3 = 6 → Return <code>6</code>
|
||||
|
||||
<div style='margin-left: 2em;'>
|
||||
|
||||
7 + 13 = 20 → Indices 0 + 3 = 3<br>
|
||||
9 + 11 = 20 → Indices 1 + 2 = 3<br>
|
||||
3 + 3 = 6 → Return `6`
|
||||
|
||||
</div>
|
||||
|
||||
</section>
|
||||
|
||||
## Instructions
|
||||
|
Reference in New Issue
Block a user