feat: add styles for markdown tables and convert some HTML tables to markdown (#38126)

This commit is contained in:
Kristofer Koishigawa 2020-02-07 17:47:35 +09:00 committed by GitHub
parent afd467f5dc
commit 4ef445c543
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
10 changed files with 375 additions and 294 deletions

View File

@ -348,6 +348,28 @@ hr {
background-color: var(--tertiary-background);
}
.challenge-instructions table {
display: inline-block;
overflow: auto;
}
.challenge-instructions table thead {
display: table-header-group;
vertical-align: middle;
border-color: inherit;
}
.challenge-instructions table th {
font-weight: 700;
}
.challenge-instructions table th,
.challenge-instructions table td {
padding: 6px 13px;
border: 1px solid var(--secondary-color);
text-align: center;
}
.help-block {
color: var(--quaternary-color);
}

View File

@ -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 &#8594; Indices 0 + 3 = 3<br>9 + 11 = 20 &#8594; Indices 1 + 2 = 3<br>3 + 3 = 6 &#8594 Return <code>6</code>
<div style='margin-left: 2em;'>
7 + 13 = 20 &#8594; Indices 0 + 3 = 3<br>
9 + 11 = 20 &#8594; Indices 1 + 2 = 3<br>
3 + 3 = 6 &#8594 Return `6`
</div>
</section>
## Instructions

View File

@ -22,12 +22,13 @@ The cards are valued in the order:2, 3, 4, 5, 6, 7, 8, 9, 10, Jack, Queen, King,
If two players have the same ranked hands then the rank made up of the highest value wins; for example, a pair of eights beats a pair of fives (see example 1 below). But if two ranks tie, for example, both players have a pair of queens, then highest cards in each hand are compared (see example 4 below); if the highest cards tie then the next highest cards are compared, and so on.
Consider the following five hands dealt to two players:
Hand Player 1 Player 2 Winner
1 5H 5C 6S 7S KDPair of Fives 2C 3S 8S 8D TDPair of Eights Player 2
2 5D 8C 9S JS ACHighest card Ace 2C 5C 7D 8S QHHighest card Queen Player 1
3 2D 9C AS AH ACThree Aces 3D 6D 7D TD QDFlush with Diamonds Player 2
4 4D 6S 9H QH QCPair of QueensHighest card Nine 3D 6D 7H QD QSPair of QueensHighest card Seven Player 1
5 2H 2D 4C 4D 4SFull HouseWith Three Fours 3C 3D 3S 9S 9DFull Housewith Three Threes Player 1
|Hand|Player 1|Player 2|Winner|
|--- |--- |--- |--- |
|<strong>1</strong>|5H 5C 6S 7S KD <br> Pair of Fives|2C 3S 8S 8D TD <br> Pair of Eights|Player 2|
|<strong>2</strong>|5D 8C 9S JS AC <br> Highest card Ace|2C 5C 7D 8S QH <br> Highest card Queen|Player 1|
|<strong>3</strong>|2D 9C AS AH AC <br> Three Aces|3D 6D 7D TD QD <br> Flush with Diamonds|Player 2|
|<strong>4</strong>|4D 6S 9H QH QC <br> Pair of Queens <br> Highest card Nine|3D 6D 7H QD QS <br> Pair of Queens <br> Highest card Seven|Player 1|
|<strong>5</strong>|2H 2D 4C 4D 4S <br> Full House <br> with Three Fours|3C 3D 3S 9S 9D <br> Full House <br> with Three Threes|Player 1|
The file, poker.txt, contains one-thousand random hands dealt to two players. Each line of the file contains ten cards (separated by a single space): the first five are Player 1's cards and the last five are Player 2's cards. You can assume that all hands are valid (no invalid characters or repeated cards), each player's hand is in no specific order, and in each hand there is a clear winner.
How many hands does Player 1 win?

View File

@ -8,36 +8,16 @@ forumTopicId: 302173
## Description
<section id='description'>
Triangle, square, pentagonal, hexagonal, heptagonal, and octagonal numbers are all figurate (polygonal) numbers and are generated by the following formulae:
Triangle
P3,n=n(n+1)/2
|Type of Number|Formula|Sequence|
|--- |--- |--- |
|Triangle|P<sub>3</sub>,<var><sub>n</sub></var>=<var>n</var>(<var>n</var>+1)/2|1, 3, 6, 10, 15, ...|
|Square|P<sub>4</sub>,<var><sub>n</sub></var>=<var>n</var><sup>2</sup>|1, 4, 9, 16, 25, ...|
|Pentagonal|P<sub>5</sub>,<var><sub>n</sub></var>=<var>n</var>(3<var>n</var>1)/2|1, 5, 12, 22, 35, ...|
|Hexagonal|P<sub>6</sub>,<var><sub>n</sub></var>=<var>n</var>(2<var>n</var>1)|1, 6, 15, 28, 45, ...|
|Heptagonal|P<sub>7</sub>,<var><sub>n</sub></var>=<var>n</var>(5<var>n</var>3)/2|1, 7, 18, 34, 55, ...|
|Octagonal|P<sub>8</sub>,<var><sub>n</sub></var>=<var>n</var>(3<var>n</var>2)|1, 8, 21, 40, 65, ...|
1, 3, 6, 10, 15, ...
Square
P4,n=n2
1, 4, 9, 16, 25, ...
Pentagonal
P5,n=n(3n1)/2
1, 5, 12, 22, 35, ...
Hexagonal
P6,n=n(2n1)
1, 6, 15, 28, 45, ...
Heptagonal
P7,n=n(5n3)/2
1, 7, 18, 34, 55, ...
Octagonal
P8,n=n(3n2)
1, 8, 21, 40, 65, ...
The ordered set of three 4-digit numbers: 8128, 2882, 8281, has three interesting properties.
The set is cyclic, in that the last two digits of each number is the first two digits of the next number (including the last number with the first).
Each polygonal type: triangle (P3,127=8128), square (P4,91=8281), and pentagonal (P5,44=2882), is represented by a different number in the set.

View File

@ -13,15 +13,20 @@ Consider the following "magic" 3-gon ring, filled with the numbers 1 to 6, and e
Working clockwise, and starting from the group of three with the numerically lowest external node (4,3,2 in this example), each solution can be described uniquely. For example, the above solution can be described by the set: 4,3,2; 6,2,1; 5,1,3.
It is possible to complete the ring with four different totals: 9, 10, 11, and 12. There are eight solutions in total.
TotalSolution Set
94,2,3; 5,3,1; 6,1,2
94,3,2; 6,2,1; 5,1,3
102,3,5; 4,5,1; 6,1,3
102,5,3; 6,3,1; 4,1,5
111,4,6; 3,6,2; 5,2,4
111,6,4; 5,4,2; 3,2,6
121,5,6; 2,6,4; 3,4,5
121,6,5; 3,5,4; 2,4,6
<div style='text-align: center;'>
|<div style='width: 100px;'>Total</div>|<div style='width: 250px;'>Solution Set</div>|
|--- |--- |
|9|4,2,3; 5,3,1; 6,1,2|
|9|4,3,2; 6,2,1; 5,1,3|
|10|2,3,5; 4,5,1; 6,1,3|
|10|2,5,3; 6,3,1; 4,1,5|
|11|1,4,6; 3,6,2; 5,2,4|
|11|1,6,4; 5,4,2; 3,2,6|
|12|1,5,6; 2,6,4; 3,4,5|
|12|1,6,5; 3,5,4; 2,4,6|
</div>
By concatenating each group it is possible to form 9-digit strings; the maximum string for a 3-gon ring is 432621513.
Using the numbers 1 to 10, and depending on arrangements, it is possible to form 16- and 17-digit strings. What is the maximum 16-digit string for a "magic" 5-gon ring?

View File

@ -7,51 +7,29 @@ forumTopicId: 302181
## Description
<section id='description'>
Euler's Totient function, φ(n) [sometimes called the phi function], is used to determine the number of numbers less than n which are relatively prime to n. For example, as 1, 2, 4, 5, 7, and 8, are all less than nine and relatively prime to nine, φ(9)=6.
n
Relatively Prime
φ(n)
n/φ(n)
2
1
1
2
3
1,2
2
1.5
4
1,3
2
2
5
1,2,3,4
4
1.25
6
1,5
2
3
7
1,2,3,4,5,6
6
1.1666...
8
1,3,5,7
4
2
9
1,2,4,5,7,8
6
1.5
10
1,3,7,9
4
2.5
Euler's Totient function, φ(<var>n</var>) [sometimes called the phi function], is used to determine the number of numbers less than <var>n</var> which are relatively prime to <var>n</var>. For example, as 1, 2, 4, 5, 7, and 8, are all less than nine and relatively prime to nine, φ(9)=6.
<div style='margin-left: 4em;'>
|<var>n</var>|Relatively Prime|φ(<var>n</var>)|<var>n</var>/φ(<var>n</var>)|
|--- |--- |--- |--- |
|2|1|1|2|
|3|1,2|2|1.5|
|4|1,3|2|2|
|5|1,2,3,4|4|1.25|
|6|1,5|2|3|
|7|1,2,3,4,5,6|6|1.1666...|
|8|1,3,5,7|4|2|
|9|1,2,4,5,7,8|6|1.5|
|10|1,3,7,9|4|2.5|
</div>
It can be seen that <var>n</var>=6 produces a maximum <var>n</var>/φ(<var>n</var>) for <var>n</var> ≤ 10.
Find the value of <var>n</var> ≤ 1,000,000 for which n/φ(<var>n</var>) is a maximum.
It can be seen that n=6 produces a maximum n/φ(n) for n ≤ 10.
Find the value of n ≤ 1,000,000 for which n/φ(n) is a maximum.
</section>
## Instructions

View File

@ -9,13 +9,21 @@ forumTopicId: 302191
<section id='description'>
Let p(n) represent the number of different ways in which n coins can be separated into piles. For example, five coins can be separated into piles in exactly seven different ways, so p(5)=7.
OOOOO
OOOO   O
OOO   OO
OOO   O   O
OO   OO   O
OO   O   O   O
O   O   O   O   O
<div style='text-align: center;'>
|Coin piles|
|--- |
|OOOOO|
|OOOO   O|
|OOO   OO|
|OOO   O   O|
|OO   OO   O|
|OO   O   O   O|
|O   O   O   O   O|
</div>
Find the least value of <var>n</var> for which p(<var>n</var>) is divisible by one million.
Find the least value of n for which p(n) is divisible by one million.
</section>

View File

@ -9,55 +9,83 @@ forumTopicId: 302198
<section id='description'>
In the game, Monopoly, the standard board is set up in the following way:
GO
A1
CC1
A2
T1
R1
B1
CH1
B2
B3
JAIL
H2
C1
T2
U1
H1
C2
CH3
C3
R4
R2
G3
D1
CC3
CC2
G2
D2
G1
D3
G2J
F3
U2
F2
F1
R3
E3
E2
CH2
E1
FP
<div style="text-align: center;">
<table cellspacing="1" cellpadding="5" border="0" style="background-color: black; color: black;" align="center">
<tbody>
<tr>
<td style="background-color: #ffffff; color: black; padding: 5px; border: 1px solid black;">GO</td>
<td style="background-color: #ffffff; color: black; padding: 5px; border: 1px solid black;">A1</td>
<td style="background-color: #ffffff; color: black; padding: 5px; border: 1px solid black;">CC1</td>
<td style="background-color: #ffffff; color: black; padding: 5px; border: 1px solid black;">A2</td>
<td style="background-color: #ffffff; color: black; padding: 5px; border: 1px solid black;">T1</td>
<td style="background-color: #ffffff; color: black; padding: 5px; border: 1px solid black;">R1</td>
<td style="background-color: #ffffff; color: black; padding: 5px; border: 1px solid black;">B1</td>
<td style="background-color: #ffffff; color: black; padding: 5px; border: 1px solid black;">CH1</td>
<td style="background-color: #ffffff; color: black; padding: 5px; border: 1px solid black;">B2</td>
<td style="background-color: #ffffff; color: black; padding: 5px; border: 1px solid black;">B3</td>
<td style="background-color: #ffffff; color: black; padding: 5px; border: 1px solid black;">JAIL</td>
</tr>
<tr>
<td style="background-color: #ffffff; color: black; padding: 5px; border: 1px solid black;">H2</td>
<td colspan="9">&nbsp;</td>
<td style="background-color: #ffffff; color: black; padding: 5px; border: 1px solid black;">C1</td>
</tr>
<tr>
<td style="background-color: #ffffff; color: black; padding: 5px; border: 1px solid black;">T2</td>
<td colspan="9">&nbsp;</td>
<td style="background-color: #ffffff; color: black; padding: 5px; border: 1px solid black;">U1</td>
</tr>
<tr>
<td style="background-color: #ffffff; color: black; padding: 5px; border: 1px solid black;">H1</td>
<td colspan="9">&nbsp;</td>
<td style="background-color: #ffffff; color: black; padding: 5px; border: 1px solid black;">C2</td>
</tr>
<tr>
<td style="background-color: #ffffff; color: black; padding: 5px; border: 1px solid black;">CH3</td>
<td colspan="9">&nbsp;</td>
<td style="background-color: #ffffff; color: black; padding: 5px; border: 1px solid black;">C3</td>
</tr>
<tr>
<td style="background-color: #ffffff; color: black; padding: 5px; border: 1px solid black;">R4</td>
<td colspan="9">&nbsp;</td>
<td style="background-color: #ffffff; color: black; padding: 5px; border: 1px solid black;">R2</td>
</tr>
<tr>
<td style="background-color: #ffffff; color: black; padding: 5px; border: 1px solid black;">G3</td>
<td colspan="9">&nbsp;</td>
<td style="background-color: #ffffff; color: black; padding: 5px; border: 1px solid black;">D1</td>
</tr>
<tr>
<td style="background-color: #ffffff; color: black; padding: 5px; border: 1px solid black;">CC3</td>
<td colspan="9">&nbsp;</td>
<td style="background-color: #ffffff; color: black; padding: 5px; border: 1px solid black;">CC2</td>
</tr>
<tr>
<td style="background-color: #ffffff; color: black; padding: 5px; border: 1px solid black;">G2</td>
<td colspan="9">&nbsp;</td>
<td style="background-color: #ffffff; color: black; padding: 5px; border: 1px solid black;">D2</td>
</tr>
<tr>
<td style="background-color: #ffffff; color: black; padding: 5px; border: 1px solid black;">G1</td>
<td colspan="9">&nbsp;</td>
<td style="background-color: #ffffff; color: black; padding: 5px; border: 1px solid black;">D3</td>
</tr>
<tr>
<td style="background-color: #ffffff; color: black; padding: 5px; border: 1px solid black;">G2J</td>
<td style="background-color: #ffffff; color: black; padding: 5px; border: 1px solid black;">F3</td>
<td style="background-color: #ffffff; color: black; padding: 5px; border: 1px solid black;">U2</td>
<td style="background-color: #ffffff; color: black; padding: 5px; border: 1px solid black;">F2</td>
<td style="background-color: #ffffff; color: black; padding: 5px; border: 1px solid black;">F1</td>
<td style="background-color: #ffffff; color: black; padding: 5px; border: 1px solid black;">R3</td>
<td style="background-color: #ffffff; color: black; padding: 5px; border: 1px solid black;">E3</td>
<td style="background-color: #ffffff; color: black; padding: 5px; border: 1px solid black;">E2</td>
<td style="background-color: #ffffff; color: black; padding: 5px; border: 1px solid black;">CH2</td>
<td style="background-color: #ffffff; color: black; padding: 5px; border: 1px solid black;">E1</td>
<td style="background-color: #ffffff; color: black; padding: 5px; border: 1px solid black;">FP</td>
</tr>
</tbody>
</table>
</div>
A player starts on the GO square and adds the scores on two 6-sided dice to determine the number of squares they advance in a clockwise direction. Without any further rules we would expect to visit each square with equal probability: 2.5%. However, landing on G2J (Go To Jail), CC (community chest), and CH (chance) changes this distribution.
In addition to G2J, and one card from each of CC and CH, that orders the player to go directly to jail, if a player rolls three consecutive doubles, they do not advance the result of their 3rd roll. Instead they proceed directly to jail.

View File

@ -10,28 +10,95 @@ forumTopicId: 302213
Su Doku (Japanese meaning number place) is the name given to a popular puzzle concept. Its origin is unclear, but credit must be attributed to Leonhard Euler who invented a similar, and much more difficult, puzzle idea called Latin Squares. The objective of Su Doku puzzles, however, is to replace the blanks (or zeros) in a 9 by 9 grid in such that each row, column, and 3 by 3 box contains each of the digits 1 to 9. Below is an example of a typical starting puzzle grid and its solution grid.
0 0 39 0 00 0 1
0 2 03 0 58 0 6
6 0 00 0 14 0 0
0 0 87 0 00 0 6
1 0 20 0 07 0 8
9 0 00 0 82 0 0
0 0 28 0 00 0 5
6 0 92 0 30 1 0
5 0 00 0 93 0 0
4 8 39 6 72 5 1
9 2 13 4 58 7 6
6 5 78 2 14 9 3
5 4 87 2 91 3 6
1 3 25 6 47 9 8
9 7 61 3 82 4 5
3 7 28 1 46 9 5
6 8 92 5 34 1 7
5 1 47 6 93 8 2
<div style="margin: auto; background-color: white; padding: 10px; width: 80%; text-align: center;">
<table border="0" cellpadding="0" cellspacing="0" align="center">
<tbody>
<tr>
<td>
<table cellpadding="5" cellspacing="0" border="1">
<tbody>
<tr>
<td style="font-family:'courier new';font-size:14pt; color: black; padding: 5px; border: 2px solid black;">
0 0 3<br />9 0 0<br />0 0 1
</td>
<td style="font-family:'courier new';font-size:14pt; color: black; padding: 5px; border: 2px solid black;">
0 2 0<br />3 0 5<br />8 0 6
</td>
<td style="font-family:'courier new';font-size:14pt; color: black; padding: 5px; border: 2px solid black;">
6 0 0<br />0 0 1<br />4 0 0
</td>
</tr>
<tr>
<td style="font-family:'courier new';font-size:14pt; color: black; padding: 5px; border: 2px solid black;">
0 0 8<br />7 0 0<br />0 0 6
</td>
<td style="font-family:'courier new';font-size:14pt; color: black; padding: 5px; border: 2px solid black;">
1 0 2<br />0 0 0<br />7 0 8
</td>
<td style="font-family:'courier new';font-size:14pt; color: black; padding: 5px; border: 2px solid black;">
9 0 0<br />0 0 8<br />2 0 0
</td>
</tr>
<tr>
<td style="font-family:'courier new';font-size:14pt; color: black; padding: 5px; border: 2px solid black;">
0 0 2<br />8 0 0<br />0 0 5
</td>
<td style="font-family:'courier new';font-size:14pt; color: black; padding: 5px; border: 2px solid black;">
6 0 9<br />2 0 3<br />0 1 0
</td>
<td style="font-family:'courier new';font-size:14pt; color: black; padding: 5px; border: 2px solid black;">
5 0 0<br />0 0 9<br />3 0 0
</td>
</tr>
</tbody>
</table>
</td>
<td width="50">
<img src="images/spacer.gif" width="50" height="1" alt="" /><br />
</td>
<td>
<table cellpadding="5" cellspacing="0" border="1">
<tbody>
<tr>
<td style="font-family:'courier new';font-size:14pt; color: black; padding: 5px; border: 2px solid black;">
4 8 3<br />9 6 7<br />2 5 1
</td>
<td style="font-family:'courier new';font-size:14pt; color: black; padding: 5px; border: 2px solid black;">
9 2 1<br />3 4 5<br />8 7 6
</td>
<td style="font-family:'courier new';font-size:14pt; color: black; padding: 5px; border: 2px solid black;">
6 5 7<br />8 2 1<br />4 9 3
</td>
</tr>
<tr>
<td style="font-family:'courier new';font-size:14pt; color: black; padding: 5px; border: 2px solid black;">
5 4 8<br />7 2 9<br />1 3 6
</td>
<td style="font-family:'courier new';font-size:14pt; color: black; padding: 5px; border: 2px solid black;">
1 3 2<br />5 6 4<br />7 9 8
</td>
<td style="font-family:'courier new';font-size:14pt; color: black; padding: 5px; border: 2px solid black;">
9 7 6<br />1 3 8<br />2 4 5
</td>
</tr>
<tr>
<td style="font-family:'courier new';font-size:14pt; color: black; padding: 5px; border: 2px solid black;">
3 7 2<br />8 1 4<br />6 9 5
</td>
<td style="font-family:'courier new';font-size:14pt; color: black; padding: 5px; border: 2px solid black;">
6 8 9<br />2 5 3<br />4 1 7
</td>
<td style="font-family:'courier new';font-size:14pt; color: black; padding: 5px; border: 2px solid black;">
5 1 4<br />7 6 9<br />3 8 2
</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</div>
A well constructed Su Doku puzzle has a unique solution and can be solved by logic, although it may be necessary to employ "guess and test" methods in order to eliminate options (there is much contested opinion over this). The complexity of the search determines the difficulty of the puzzle; the example above is considered easy because it can be solved by straight forward direct deduction.
The 6K text file, sudoku.txt (right click and 'Save Link/Target As...'), contains fifty different Su Doku puzzles ranging in difficulty, but all with unique solutions (the first puzzle in the file is the example above).

View File

@ -36,136 +36,109 @@ In pseudo-code, the algorithm could be expressed as follows:
## Instructions
<section id='instructions'>
Implement the "hash join" algorithm as a function and demonstrate that it passes the test-case listed below. The function should accept two arrays of objects and return an array of combined objects.
<h4><strong>Input</strong></h4>
<table>
<tr>
<td style="padding: 4px; margin: 5px;">
<table style="border:none; border-collapse:collapse;">
<tr>
<td style="border:none"> <i>A =</i>
</td>
<td style="border:none">
<table>
<tr>
<th style="padding: 4px; margin: 5px;"> Age </th>
<th style="padding: 4px; margin: 5px;"> Name
</th></tr>
<tr>
<td style="padding: 4px; margin: 5px;"> 27 </td>
<td style="padding: 4px; margin: 5px;"> Jonah
</td></tr>
<tr>
<td style="padding: 4px; margin: 5px;"> 18 </td>
<td style="padding: 4px; margin: 5px;"> Alan
</td></tr>
<tr>
<td style="padding: 4px; margin: 5px;"> 28 </td>
<td style="padding: 4px; margin: 5px;"> Glory
</td></tr>
<tr>
<td style="padding: 4px; margin: 5px;"> 18 </td>
<td style="padding: 4px; margin: 5px;"> Popeye
</td></tr>
<tr>
<td style="padding: 4px; margin: 5px;"> 28 </td>
<td style="padding: 4px; margin: 5px;"> Alan
</td></tr></table>
</td>
<td style="border:none; padding-left:1.5em;" rowspan="2">
</td>
<td style="border:none"> <i>B =</i>
</td>
<td style="border:none">
<table>
<tr>
<th style="padding: 4px; margin: 5px;"> Character </th>
<th style="padding: 4px; margin: 5px;"> Nemesis
</th></tr>
<tr>
<td style="padding: 4px; margin: 5px;"> Jonah </td>
<td style="padding: 4px; margin: 5px;"> Whales
</td></tr>
<tr>
<td style="padding: 4px; margin: 5px;"> Jonah </td>
<td style="padding: 4px; margin: 5px;"> Spiders
</td></tr>
<tr>
<td style="padding: 4px; margin: 5px;"> Alan </td>
<td style="padding: 4px; margin: 5px;"> Ghosts
</td></tr>
<tr>
<td style="padding: 4px; margin: 5px;"> Alan </td>
<td style="padding: 4px; margin: 5px;"> Zombies
</td></tr>
<tr>
<td style="padding: 4px; margin: 5px;"> Glory </td>
<td style="padding: 4px; margin: 5px;"> Buffy
</td></tr></table>
</td></tr>
<tr>
<td style="border:none"> <i>j<sub>A</sub> =</i>
</td>
<td style="border:none"> <i><code>Name</code> (i.e. column 1)</i>
</td>
<td style="border:none"> <i>j<sub>B</sub> =</i>
</td>
<td style="border:none"> <i><code>Character</code> (i.e. column 0)</i>
</td></tr></table>
</td>
<td style="padding: 4px; margin: 5px;">
</td></tr></table>
<tr>
<td style="padding: 4px; margin: 5px;">
<table style="border:none; border-collapse:collapse;">
<tr>
<td style="border:none"><i>A =</i></td>
<td style="border:none">
<table>
<tr>
<th style="padding: 4px; margin: 5px;">Age</th>
<th style="padding: 4px; margin: 5px;">Name</th>
</tr>
<tr>
<td style="padding: 4px; margin: 5px;">27</td>
<td style="padding: 4px; margin: 5px;">Jonah</td>
</tr>
<tr>
<td style="padding: 4px; margin: 5px;">18</td>
<td style="padding: 4px; margin: 5px;">Alan</td>
</tr>
<tr>
<td style="padding: 4px; margin: 5px;">28</td>
<td style="padding: 4px; margin: 5px;">Glory</td>
</tr>
<tr>
<td style="padding: 4px; margin: 5px;">18</td>
<td style="padding: 4px; margin: 5px;">Popeye</td>
</tr>
<tr>
<td style="padding: 4px; margin: 5px;">28</td>
<td style="padding: 4px; margin: 5px;">Alan</td>
</tr>
</table>
</td>
<td style="border:none; padding-left:1.5em;" rowspan="2"></td>
<td style="border:none"><i>B =</i></td>
<td style="border:none">
<table>
<tr>
<th style="padding: 4px; margin: 5px;">Character</th>
<th style="padding: 4px; margin: 5px;">Nemesis</th>
</tr>
<tr>
<td style="padding: 4px; margin: 5px;">Jonah</td>
<td style="padding: 4px; margin: 5px;">Whales</td>
</tr>
<tr>
<td style="padding: 4px; margin: 5px;">Jonah</td>
<td style="padding: 4px; margin: 5px;">Spiders</td>
</tr>
<tr>
<td style="padding: 4px; margin: 5px;">Alan</td>
<td style="padding: 4px; margin: 5px;">Ghosts</td>
</tr>
<tr>
<td style="padding: 4px; margin: 5px;">Alan</td>
<td style="padding: 4px; margin: 5px;">Zombies</td>
</tr>
<tr>
<td style="padding: 4px; margin: 5px;">Glory</td>
<td style="padding: 4px; margin: 5px;">Buffy</td>
</tr>
</table>
</td>
</tr>
<tr>
<td style="border:none">
<i>j<sub>A</sub> =</i>
</td>
<td style="border:none">
<i><code>Name</code> (i.e. column 1)</i>
</td>
<td style="border:none">
<i>j<sub>B</sub> =</i>
</td>
<td style="border:none">
<i><code>Character</code> (i.e. column 0)</i>
</td>
</tr>
</table>
</td>
</tr>
</table>
<h4><strong>Output</strong></h4>
<table>
<tr>
<th style="padding: 4px; margin: 5px;"> A_age </th>
<th style="padding: 4px; margin: 5px;"> A_name </th>
<th style="padding: 4px; margin: 5px;"> B_character </th>
<th style="padding: 4px; margin: 5px;"> B_nemesis
</th></tr>
<tr>
<td style="padding: 4px; margin: 5px;"> 27 </td>
<td style="padding: 4px; margin: 5px;"> Jonah </td>
<td style="padding: 4px; margin: 5px;"> Jonah </td>
<td style="padding: 4px; margin: 5px;"> Whales
</td></tr>
<tr>
<td style="padding: 4px; margin: 5px;"> 27 </td>
<td style="padding: 4px; margin: 5px;"> Jonah </td>
<td style="padding: 4px; margin: 5px;"> Jonah </td>
<td style="padding: 4px; margin: 5px;"> Spiders
</td></tr>
<tr>
<td style="padding: 4px; margin: 5px;"> 18 </td>
<td style="padding: 4px; margin: 5px;"> Alan </td>
<td style="padding: 4px; margin: 5px;"> Alan </td>
<td style="padding: 4px; margin: 5px;"> Ghosts
</td></tr>
<tr>
<td style="padding: 4px; margin: 5px;"> 18 </td>
<td style="padding: 4px; margin: 5px;"> Alan </td>
<td style="padding: 4px; margin: 5px;"> Alan </td>
<td style="padding: 4px; margin: 5px;"> Zombies
</td></tr>
<tr>
<td style="padding: 4px; margin: 5px;"> 28 </td>
<td style="padding: 4px; margin: 5px;"> Glory </td>
<td style="padding: 4px; margin: 5px;"> Glory </td>
<td style="padding: 4px; margin: 5px;"> Buffy
</td></tr>
<tr>
<td style="padding: 4px; margin: 5px;"> 28 </td>
<td style="padding: 4px; margin: 5px;"> Alan </td>
<td style="padding: 4px; margin: 5px;"> Alan </td>
<td style="padding: 4px; margin: 5px;"> Ghosts
</td></tr>
<tr>
<td style="padding: 4px; margin: 5px;"> 28 </td>
<td style="padding: 4px; margin: 5px;"> Alan </td>
<td style="padding: 4px; margin: 5px;"> Alan </td>
<td style="padding: 4px; margin: 5px;"> Zombies
</td></tr></table>
|A_age|A_name|B_character|B_nemesis|
|--- |--- |--- |--- |
|27|Jonah|Jonah|Whales|
|27|Jonah|Jonah|Spiders|
|18|Alan|Alan|Ghosts|
|18|Alan|Alan|Zombies|
|28|Glory|Glory|Buffy|
|28|Alan|Alan|Ghosts|
|28|Alan|Alan|Zombies|
The order of the rows in the output table is not significant.
</section>
## Tests