Skip to content

Commit 10e50d5

Browse files
authored
Sync docs and metadata (#766)
* Sync descriptions and metadata * Fix typo in eliuds-eggs append file * sync anagram docs
1 parent c666ad5 commit 10e50d5

File tree

27 files changed

+180
-104
lines changed

27 files changed

+180
-104
lines changed
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,12 @@
11
# Instructions
22

3-
Your task is to, given a target word and a set of candidate words, to find the subset of the candidates that are anagrams of the target.
3+
Given a target word and one or more candidate words, your task is to find the candidates that are anagrams of the target.
44

55
An anagram is a rearrangement of letters to form a new word: for example `"owns"` is an anagram of `"snow"`.
66
A word is _not_ its own anagram: for example, `"stop"` is not an anagram of `"stop"`.
77

8-
The target and candidates are words of one or more ASCII alphabetic characters (`A`-`Z` and `a`-`z`).
9-
Lowercase and uppercase characters are equivalent: for example, `"PoTS"` is an anagram of `"sTOp"`, but `StoP` is not an anagram of `sTOp`.
10-
The anagram set is the subset of the candidate set that are anagrams of the target (in any order).
11-
Words in the anagram set should have the same letter case as in the candidate set.
8+
The target word and candidate words are made up of one or more ASCII alphabetic characters (`A`-`Z` and `a`-`z`).
9+
Lowercase and uppercase characters are equivalent: for example, `"PoTS"` is an anagram of `"sTOp"`, but `"StoP"` is not an anagram of `"sTOp"`.
10+
The words you need to find should be taken from the candidate words, using the same letter case.
1211

13-
Given the target `"stone"` and candidates `"stone"`, `"tones"`, `"banana"`, `"tons"`, `"notes"`, `"Seton"`, the anagram set is `"tones"`, `"notes"`, `"Seton"`.
12+
Given the target `"stone"` and the candidate words `"stone"`, `"tones"`, `"banana"`, `"tons"`, `"notes"`, and `"Seton"`, the anagram words you need to find are `"tones"`, `"notes"`, and `"Seton"`.

exercises/practice/atbash-cipher/.docs/instructions.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Instructions
22

3-
Create an implementation of the atbash cipher, an ancient encryption system created in the Middle East.
3+
Create an implementation of the Atbash cipher, an ancient encryption system created in the Middle East.
44

55
The Atbash cipher is a simple substitution cipher that relies on transposing all the letters in the alphabet such that the resulting alphabet is backwards.
66
The first letter is replaced with the last letter, the second with the second-last, and so on.

exercises/practice/atbash-cipher/.meta/config.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
".meta/example.clj"
2525
]
2626
},
27-
"blurb": "Create an implementation of the atbash cipher, an ancient encryption system created in the Middle East.",
27+
"blurb": "Create an implementation of the Atbash cipher, an ancient encryption system created in the Middle East.",
2828
"source": "Wikipedia",
2929
"source_url": "https://en.wikipedia.org/wiki/Atbash"
3030
}
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,8 @@
11
# Instructions
22

3-
Correctly determine the fewest number of coins to be given to a customer such that the sum of the coins' value would equal the correct amount of change.
3+
Determine the fewest number of coins to give a customer so that the sum of their values equals the correct amount of change.
44

5-
## For example
5+
## Examples
66

7-
- An input of 15 with [1, 5, 10, 25, 100] should return one nickel (5) and one dime (10) or [5, 10]
8-
- An input of 40 with [1, 5, 10, 25, 100] should return one nickel (5) and one dime (10) and one quarter (25) or [5, 10, 25]
9-
10-
## Edge cases
11-
12-
- Does your algorithm work for any given set of coins?
13-
- Can you ask for negative change?
14-
- Can you ask for a change value smaller than the smallest coin value?
7+
- An amount of 15 with available coin values [1, 5, 10, 25, 100] should return one coin of value 5 and one coin of value 10, or [5, 10].
8+
- An amount of 40 with available coin values [1, 5, 10, 25, 100] should return one coin of value 5, one coin of value 10, and one coin of value 25, or [5, 10, 25].
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
# Introduction
2+
3+
In the mystical village of Coinholt, you stand behind the counter of your bakery, arranging a fresh batch of pastries.
4+
The door creaks open, and in walks Denara, a skilled merchant with a keen eye for quality goods.
5+
After a quick meal, she slides a shimmering coin across the counter, representing a value of 100 units.
6+
7+
You smile, taking the coin, and glance at the total cost of the meal: 88 units.
8+
That means you need to return 12 units in change.
9+
10+
Denara holds out her hand expectantly.
11+
"Just give me the fewest coins," she says with a smile.
12+
"My pouch is already full, and I don't want to risk losing them on the road."
13+
14+
You know you have a few options.
15+
"We have Lumis (worth 10 units), Viras (worth 5 units), and Zenth (worth 2 units) available for change."
16+
17+
You quickly calculate the possibilities in your head:
18+
19+
- one Lumis (1 × 10 units) + one Zenth (1 × 2 units) = 2 coins total
20+
- two Viras (2 × 5 units) + one Zenth (1 × 2 units) = 3 coins total
21+
- six Zenth (6 × 2 units) = 6 coins total
22+
23+
"The best choice is two coins: one Lumis and one Zenth," you say, handing her the change.
24+
25+
Denara smiles, clearly impressed.
26+
"As always, you've got it right."
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,3 @@
11
# Instructions
22

3-
The Collatz Conjecture or 3x+1 problem can be summarized as follows:
4-
5-
Take any positive integer n.
6-
If n is even, divide n by 2 to get n / 2.
7-
If n is odd, multiply n by 3 and add 1 to get 3n + 1.
8-
Repeat the process indefinitely.
9-
The conjecture states that no matter which number you start with, you will always reach 1 eventually.
10-
11-
Given a number n, return the number of steps required to reach 1.
12-
13-
## Examples
14-
15-
Starting with n = 12, the steps would be as follows:
16-
17-
0. 12
18-
1. 6
19-
2. 3
20-
3. 10
21-
4. 5
22-
5. 16
23-
6. 8
24-
7. 4
25-
8. 2
26-
9. 1
27-
28-
Resulting in 9 steps.
29-
So for input n = 12, the return value would be 9.
3+
Given a positive integer, return the number of steps it takes to reach 1 according to the rules of the Collatz Conjecture.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
# Introduction
2+
3+
One evening, you stumbled upon an old notebook filled with cryptic scribbles, as though someone had been obsessively chasing an idea.
4+
On one page, a single question stood out: **Can every number find its way to 1?**
5+
It was tied to something called the **Collatz Conjecture**, a puzzle that has baffled thinkers for decades.
6+
7+
The rules were deceptively simple.
8+
Pick any positive integer.
9+
10+
- If it's even, divide it by 2.
11+
- If it's odd, multiply it by 3 and add 1.
12+
13+
Then, repeat these steps with the result, continuing indefinitely.
14+
15+
Curious, you picked number 12 to test and began the journey:
16+
17+
12 ➜ 6 ➜ 3 ➜ 10 ➜ 5 ➜ 16 ➜ 8 ➜ 4 ➜ 2 ➜ 1
18+
19+
Counting from the second number (6), it took 9 steps to reach 1, and each time the rules repeated, the number kept changing.
20+
At first, the sequence seemed unpredictable — jumping up, down, and all over.
21+
Yet, the conjecture claims that no matter the starting number, we'll always end at 1.
22+
23+
It was fascinating, but also puzzling.
24+
Why does this always seem to work?
25+
Could there be a number where the process breaks down, looping forever or escaping into infinity?
26+
The notebook suggested solving this could reveal something profound — and with it, fame, [fortune][collatz-prize], and a place in history awaits whoever could unlock its secrets.
27+
28+
[collatz-prize]: https://mathprize.net/posts/collatz-conjecture/

exercises/practice/collatz-conjecture/.meta/config.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,6 @@
1818
]
1919
},
2020
"blurb": "Calculate the number of steps to reach 1 using the Collatz conjecture.",
21-
"source": "An unsolved problem in mathematics named after mathematician Lothar Collatz",
22-
"source_url": "https://en.wikipedia.org/wiki/3x_%2B_1_problem"
21+
"source": "Wikipedia",
22+
"source_url": "https://en.wikipedia.org/wiki/Collatz_conjecture"
2323
}

exercises/practice/dominoes/.docs/instructions.md

+3-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,9 @@
22

33
Make a chain of dominoes.
44

5-
Compute a way to order a given set of dominoes in such a way that they form a correct domino chain (the dots on one half of a stone match the dots on the neighboring half of an adjacent stone) and that dots on the halves of the stones which don't have a neighbor (the first and last stone) match each other.
5+
Compute a way to order a given set of domino stones so that they form a correct domino chain.
6+
In the chain, the dots on one half of a stone must match the dots on the neighboring half of an adjacent stone.
7+
Additionally, the dots on the halves of the stones without neighbors (the first and last stone) must match each other.
68

79
For example given the stones `[2|1]`, `[2|3]` and `[1|3]` you should compute something
810
like `[1|2] [2|3] [3|1]` or `[3|2] [2|1] [1|3]` or `[1|3] [3|2] [2|1]` etc, where the first and last numbers are the same.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# Introduction
2+
3+
In Toyland, the trains are always busy delivering treasures across the city, from shiny marbles to rare building blocks.
4+
The tracks they run on are made of colorful domino-shaped pieces, each marked with two numbers.
5+
For the trains to move, the dominoes must form a perfect chain where the numbers match.
6+
7+
Today, an urgent delivery of rare toys is on hold.
8+
You've been handed a set of track pieces to inspect.
9+
If they can form a continuous chain, the train will be on its way, bringing smiles across Toyland.
10+
If not, the set will be discarded, and another will be tried.
11+
12+
The toys are counting on you to solve this puzzle.
13+
Will the dominoes connect the tracks and send the train rolling, or will the set be left behind?

exercises/practice/eliuds-eggs/.docs/instructions.append.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,6 @@ The instructions above are synchronized with a shared repository to ensure consi
77
This appendix provides additional clarification or modifies the instructions as needed to better align with the goals of the Clojure track.
88
~~~~
99

10-
It is important not to use existing built-in functions with similar functionality to the function are implementing, as doing so would diminish the intended learning value of the exercise.
10+
It is important not to use existing built-in functions with similar functionality to the function you are implementing, as doing so would diminish the intended learning value of the exercise.
1111
In Clojure, there is no built-in function to count the number of bits in a number, so you may use any Clojure function in your implementation.
1212
However, Java does include a function for this purpose: `bitCount`.

exercises/practice/eliuds-eggs/.docs/introduction.md

+33-15
Original file line numberDiff line numberDiff line change
@@ -12,36 +12,54 @@ The position information encoding is calculated as follows:
1212
2. Convert the number from binary to decimal.
1313
3. Show the result on the display.
1414

15-
Example 1:
15+
## Example 1
16+
17+
![Seven individual nest boxes arranged in a row whose first, third, fourth and seventh nests each have a single egg.](https://assets.exercism.org/images/exercises/eliuds-eggs/example-1-coop.svg)
1618

1719
```text
18-
Chicken Coop:
1920
_ _ _ _ _ _ _
2021
|E| |E|E| | |E|
22+
```
23+
24+
### Resulting Binary
25+
26+
![1011001](https://assets.exercism.org/images/exercises/eliuds-eggs/example-1-binary.svg)
27+
28+
```text
29+
_ _ _ _ _ _ _
30+
|1|0|1|1|0|0|1|
31+
```
2132

22-
Resulting Binary:
23-
1 0 1 1 0 0 1
33+
### Decimal number on the display
2434

25-
Decimal number on the display:
2635
89
2736

28-
Actual eggs in the coop:
37+
### Actual eggs in the coop
38+
2939
4
40+
41+
## Example 2
42+
43+
![Seven individual nest boxes arranged in a row where only the fourth nest has an egg.](https://assets.exercism.org/images/exercises/eliuds-eggs/example-2-coop.svg)
44+
45+
```text
46+
_ _ _ _ _ _ _
47+
| | | |E| | | |
3048
```
3149

32-
Example 2:
50+
### Resulting Binary
51+
52+
![0001000](https://assets.exercism.org/images/exercises/eliuds-eggs/example-2-binary.svg)
3353

3454
```text
35-
Chicken Coop:
36-
_ _ _ _ _ _ _ _
37-
| | | |E| | | | |
55+
_ _ _ _ _ _ _
56+
|0|0|0|1|0|0|0|
57+
```
3858

39-
Resulting Binary:
40-
0 0 0 1 0 0 0 0
59+
### Decimal number on the display
4160

42-
Decimal number on the display:
4361
16
4462

45-
Actual eggs in the coop:
63+
### Actual eggs in the coop
64+
4665
1
47-
```
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,21 @@
11
# Instructions
22

3-
Given students' names along with the grade that they are in, create a roster for the school.
3+
Given students' names along with the grade they are in, create a roster for the school.
44

55
In the end, you should be able to:
66

7-
- Add a student's name to the roster for a grade
7+
- Add a student's name to the roster for a grade:
88
- "Add Jim to grade 2."
99
- "OK."
10-
- Get a list of all students enrolled in a grade
10+
- Get a list of all students enrolled in a grade:
1111
- "Which students are in grade 2?"
12-
- "We've only got Jim just now."
12+
- "We've only got Jim right now."
1313
- Get a sorted list of all students in all grades.
14-
Grades should sort as 1, 2, 3, etc., and students within a grade should be sorted alphabetically by name.
15-
- "Who all is enrolled in school right now?"
14+
Grades should be sorted as 1, 2, 3, etc., and students within a grade should be sorted alphabetically by name.
15+
- "Who is enrolled in school right now?"
1616
- "Let me think.
17-
We have Anna, Barb, and Charlie in grade 1, Alex, Peter, and Zoe in grade 2 and Jim in grade 5.
18-
So the answer is: Anna, Barb, Charlie, Alex, Peter, Zoe and Jim"
17+
We have Anna, Barb, and Charlie in grade 1, Alex, Peter, and Zoe in grade 2, and Jim in grade 5.
18+
So the answer is: Anna, Barb, Charlie, Alex, Peter, Zoe, and Jim."
1919

20-
Note that all our students only have one name (It's a small town, what do you want?) and each student cannot be added more than once to a grade or the roster.
21-
In fact, when a test attempts to add the same student more than once, your implementation should indicate that this is incorrect.
20+
Note that all our students only have one name (it's a small town, what do you want?), and each student cannot be added more than once to a grade or the roster.
21+
If a test attempts to add the same student more than once, your implementation should indicate that this is incorrect.

exercises/practice/grains/.meta/config.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,5 +26,5 @@
2626
},
2727
"blurb": "Calculate the number of grains of wheat on a chessboard given that the number on each square doubles.",
2828
"source": "The CodeRanch Cattle Drive, Assignment 6",
29-
"source_url": "https://coderanch.com/wiki/718824/Grains"
29+
"source_url": "https://web.archive.org/web/20240908084142/https://coderanch.com/wiki/718824/Grains"
3030
}

exercises/practice/hamming/.docs/instructions.md

-11
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,6 @@
22

33
Calculate the Hamming distance between two DNA strands.
44

5-
Your body is made up of cells that contain DNA.
6-
Those cells regularly wear out and need replacing, which they achieve by dividing into daughter cells.
7-
In fact, the average human body experiences about 10 quadrillion cell divisions in a lifetime!
8-
9-
When cells divide, their DNA replicates too.
10-
Sometimes during this process mistakes happen and single pieces of DNA get encoded with the incorrect information.
11-
If we compare two strands of DNA and count the differences between them we can see how many mistakes occurred.
12-
This is known as the "Hamming distance".
13-
145
We read DNA using the letters C, A, G and T.
156
Two strands might look like this:
167

@@ -20,8 +11,6 @@ Two strands might look like this:
2011

2112
They have 7 differences, and therefore the Hamming distance is 7.
2213

23-
The Hamming distance is useful for lots of things in science, not just biology, so it's a nice phrase to be familiar with :)
24-
2514
## Implementation notes
2615

2716
The Hamming distance is only defined for sequences of equal length, so an attempt to calculate it between sequences of different lengths should not work.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# Introduction
2+
3+
Your body is made up of cells that contain DNA.
4+
Those cells regularly wear out and need replacing, which they achieve by dividing into daughter cells.
5+
In fact, the average human body experiences about 10 quadrillion cell divisions in a lifetime!
6+
7+
When cells divide, their DNA replicates too.
8+
Sometimes during this process mistakes happen and single pieces of DNA get encoded with the incorrect information.
9+
If we compare two strands of DNA and count the differences between them, we can see how many mistakes occurred.
10+
This is known as the "Hamming distance".
11+
12+
The Hamming distance is useful in many areas of science, not just biology, so it's a nice phrase to be familiar with :)

exercises/practice/hamming/.meta/config.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
".meta/example.clj"
2020
]
2121
},
22-
"blurb": "Calculate the Hamming difference between two DNA strands.",
22+
"blurb": "Calculate the Hamming distance between two DNA strands.",
2323
"source": "The Calculating Point Mutations problem at Rosalind",
2424
"source_url": "https://rosalind.info/problems/hamm/"
2525
}

exercises/practice/leap/.meta/config.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -31,5 +31,5 @@
3131
},
3232
"blurb": "Determine whether a given year is a leap year.",
3333
"source": "CodeRanch Cattle Drive, Assignment 3",
34-
"source_url": "https://coderanch.com/t/718816/Leap"
34+
"source_url": "https://web.archive.org/web/20240907033714/https://coderanch.com/t/718816/Leap"
3535
}

exercises/practice/luhn/.docs/instructions.md

+3-5
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,10 @@
11
# Instructions
22

3-
Given a number determine whether or not it is valid per the Luhn formula.
3+
Determine whether a credit card number is valid according to the [Luhn formula][luhn].
44

5-
The [Luhn algorithm][luhn] is a simple checksum formula used to validate a variety of identification numbers, such as credit card numbers and Canadian Social Insurance Numbers.
5+
The number will be provided as a string.
66

7-
The task is to check if a given string is valid.
8-
9-
## Validating a Number
7+
## Validating a number
108

119
Strings of length 1 or less are not valid.
1210
Spaces are allowed in the input, but they should be stripped before checking.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# Introduction
2+
3+
At the Global Verification Authority, you've just been entrusted with a critical assignment.
4+
Across the city, from online purchases to secure logins, countless operations rely on the accuracy of numerical identifiers like credit card numbers, bank account numbers, transaction codes, and tracking IDs.
5+
The Luhn algorithm is a simple checksum formula used to ensure these numbers are valid and error-free.
6+
7+
A batch of identifiers has just arrived on your desk.
8+
All of them must pass the Luhn test to ensure they're legitimate.
9+
If any fail, they'll be flagged as invalid, preventing errors or fraud, such as incorrect transactions or unauthorized access.
10+
11+
Can you ensure this is done right? The integrity of many services depends on you.

exercises/practice/pascals-triangle/.docs/introduction.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ Over the next hour, your teacher reveals some amazing things hidden in this tria
1313
- It contains the Fibonacci sequence.
1414
- If you color odd and even numbers differently, you get a beautiful pattern called the [Sierpiński triangle][wikipedia-sierpinski-triangle].
1515

16-
The teacher implores you and your classmates to lookup other uses, and assures you that there are lots more!
16+
The teacher implores you and your classmates to look up other uses, and assures you that there are lots more!
1717
At that moment, the school bell rings.
1818
You realize that for the past hour, you were completely absorbed in learning about Pascal's triangle.
1919
You quickly grab your laptop from your bag and go outside, ready to enjoy both the sunshine _and_ the wonders of Pascal's triangle.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# Introduction
2+
3+
You've joined LinkLine, a leading communications company working to ensure reliable connections for everyone.
4+
The team faces a big challenge: users submit phone numbers in all sorts of formats — dashes, spaces, dots, parentheses, and even prefixes.
5+
Some numbers are valid, while others are impossible to use.
6+
7+
Your mission is to turn this chaos into order.
8+
You'll clean up valid numbers, formatting them appropriately for use in the system.
9+
At the same time, you'll identify and filter out any invalid entries.
10+
11+
The success of LinkLine's operations depends on your ability to separate the useful from the unusable.
12+
Are you ready to take on the challenge and keep the connections running smoothly?

0 commit comments

Comments
 (0)