Skip to content

Commit d2588c4

Browse files
committed
fully separate lists from paragraphs
1 parent a159fbf commit d2588c4

2 files changed

Lines changed: 5 additions & 1 deletion

File tree

‎exercises/practice/roman-numerals/.approaches/introduction.md‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,14 @@ The system is inherently decimal: the number of human fingers has not changed si
1212
However, there is no zero value available, so Roman numerals represent powers of 10 with different letters (I, X, C, and M), not by position (1, 10, 100, 1000, etc).
1313

1414
The approaches to this exercise break down into two groups, with many variants in each:
15+
1516
1. Split the input number into digits, and translate each separately.
1617
2. Iterate through the Roman numbers, from large to small, and convert the largest valid number at each step.
1718

1819
## Digit-by-digit approaches
1920

20-
The concept behind this class of approaches:
21+
The process behind this class of approaches:
22+
2123
1. Split the input number into decimal digits.
2224
2. For each digit, get the Roman equivalent and append to a list.
2325
3. Join the list into a string and return it.
@@ -83,6 +85,7 @@ See the [`table-lookup`][table-lookup] approach for details.
8385
## Loop over Romans approaches
8486

8587
In this class of approaches we:
88+
8689
1. Create a mapping from Roman to Arabic numbers, in some suitable format. (_`dicts` or `tuples` work well._)
8790
2. Iterate nested loops, a `for` and a `while`, in either order.
8891
3. At each step, append the largest possible Roman number to a list and subtract the corresponding value from the number being converted.

‎exercises/practice/roman-numerals/.approaches/loop-over-romans/content.md‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,7 @@ def roman(number: int) -> str:
104104

105105

106106
These five solutions all share some common features:
107+
107108
- Some sort of translation lookup.
108109
- Nested loops, a `while` and a `for`, in either order (except the last one).
109110
- At each step, find the largest number that can be subtracted from the decimal input and appended to the Roman representation.

0 commit comments

Comments
 (0)