Skip to content

Commit 60b19a6

Browse files
authored
Synced practice exercise docs to problem specificatons. (#3573)
1 parent d2be549 commit 60b19a6

File tree

4 files changed

+43
-29
lines changed

4 files changed

+43
-29
lines changed

exercises/practice/perfect-numbers/.docs/instructions.md

Lines changed: 30 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -2,22 +2,38 @@
22

33
Determine if a number is perfect, abundant, or deficient based on Nicomachus' (60 - 120 CE) classification scheme for positive integers.
44

5-
The Greek mathematician [Nicomachus][nicomachus] devised a classification scheme for positive integers, identifying each as belonging uniquely to the categories of **perfect**, **abundant**, or **deficient** based on their [aliquot sum][aliquot-sum].
6-
The aliquot sum is defined as the sum of the factors of a number not including the number itself.
5+
The Greek mathematician [Nicomachus][nicomachus] devised a classification scheme for positive integers, identifying each as belonging uniquely to the categories of [perfect](#perfect), [abundant](#abundant), or [deficient](#deficient) based on their [aliquot sum][aliquot-sum].
6+
The _aliquot sum_ is defined as the sum of the factors of a number not including the number itself.
77
For example, the aliquot sum of `15` is `1 + 3 + 5 = 9`.
88

9-
- **Perfect**: aliquot sum = number
10-
- 6 is a perfect number because (1 + 2 + 3) = 6
11-
- 28 is a perfect number because (1 + 2 + 4 + 7 + 14) = 28
12-
- **Abundant**: aliquot sum > number
13-
- 12 is an abundant number because (1 + 2 + 3 + 4 + 6) = 16
14-
- 24 is an abundant number because (1 + 2 + 3 + 4 + 6 + 8 + 12) = 36
15-
- **Deficient**: aliquot sum < number
16-
- 8 is a deficient number because (1 + 2 + 4) = 7
17-
- Prime numbers are deficient
18-
19-
Implement a way to determine whether a given number is **perfect**.
20-
Depending on your language track, you may also need to implement a way to determine whether a given number is **abundant** or **deficient**.
9+
## Perfect
10+
11+
A number is perfect when it equals its aliquot sum.
12+
For example:
13+
14+
- `6` is a perfect number because `1 + 2 + 3 = 6`
15+
- `28` is a perfect number because `1 + 2 + 4 + 7 + 14 = 28`
16+
17+
## Abundant
18+
19+
A number is abundant when it is less than its aliquot sum.
20+
For example:
21+
22+
- `12` is an abundant number because `1 + 2 + 3 + 4 + 6 = 16`
23+
- `24` is an abundant number because `1 + 2 + 3 + 4 + 6 + 8 + 12 = 36`
24+
25+
## Deficient
26+
27+
A number is deficient when it is greater than its aliquot sum.
28+
For example:
29+
30+
- `8` is a deficient number because `1 + 2 + 4 = 7`
31+
- Prime numbers are deficient
32+
33+
## Task
34+
35+
Implement a way to determine whether a given number is [perfect](#perfect).
36+
Depending on your language track, you may also need to implement a way to determine whether a given number is [abundant](#abundant) or [deficient](#deficient).
2137

2238
[nicomachus]: https://en.wikipedia.org/wiki/Nicomachus
2339
[aliquot-sum]: https://en.wikipedia.org/wiki/Aliquot_sum

exercises/practice/phone-number/.docs/instructions.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,14 @@ The first three digits of the local number represent the _exchange code_, follow
1111
The format is usually represented as
1212

1313
```text
14-
(NXX)-NXX-XXXX
14+
NXX NXX-XXXX
1515
```
1616

1717
where `N` is any digit from 2 through 9 and `X` is any digit from 0 through 9.
1818

19-
Your task is to clean up differently formatted telephone numbers by removing punctuation and the country code (1) if present.
19+
Sometimes they also have the country code (represented as `1` or `+1`) prefixed.
20+
21+
Your task is to clean up differently formatted telephone numbers by removing punctuation and the country code if present.
2022

2123
For example, the inputs
2224

exercises/practice/queen-attack/.docs/instructions.md

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -8,18 +8,14 @@ A chessboard can be represented by an 8 by 8 array.
88

99
So if you are told the white queen is at `c5` (zero-indexed at column 2, row 3) and the black queen at `f2` (zero-indexed at column 5, row 6), then you know that the set-up is like so:
1010

11-
```text
12-
a b c d e f g h
13-
8 _ _ _ _ _ _ _ _ 8
14-
7 _ _ _ _ _ _ _ _ 7
15-
6 _ _ _ _ _ _ _ _ 6
16-
5 _ _ W _ _ _ _ _ 5
17-
4 _ _ _ _ _ _ _ _ 4
18-
3 _ _ _ _ _ _ _ _ 3
19-
2 _ _ _ _ _ B _ _ 2
20-
1 _ _ _ _ _ _ _ _ 1
21-
a b c d e f g h
22-
```
11+
![A chess board with two queens. Arrows emanating from the queen at c5 indicate possible directions of capture along file, rank and diagonal.](https://assets.exercism.org/images/exercises/queen-attack/queen-capture.svg)
2312

2413
You are also able to answer whether the queens can attack each other.
2514
In this case, that answer would be yes, they can, because both pieces share a diagonal.
15+
16+
## Credit
17+
18+
The chessboard image was made by [habere-et-dispertire][habere-et-dispertire] using LaTeX and the [chessboard package][chessboard-package] by Ulrike Fischer.
19+
20+
[habere-et-dispertire]: https://exercism.org/profiles/habere-et-dispertire
21+
[chessboard-package]: https://github.com/u-fischer/chessboard

exercises/practice/rest-api/.docs/instructions.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,5 +44,5 @@ Your task is to implement a simple [RESTful API][restful-wikipedia] that receive
4444
[restful-wikipedia]: https://en.wikipedia.org/wiki/Representational_state_transfer
4545
[iou]: https://en.wikipedia.org/wiki/IOU
4646
[github-rest]: https://developer.github.com/v3/
47-
[reddit-rest]: https://www.reddit.com/dev/api/
47+
[reddit-rest]: https://web.archive.org/web/20231202231149/https://www.reddit.com/dev/api/
4848
[restfulapi]: https://restfulapi.net/

0 commit comments

Comments
 (0)