Skip to content

Commit a97aa12

Browse files
kytrinyxkotp
authored andcommitted
Sync change with problem-specifications
The sync brought in new docs and metadata, as well as an extra test in tests.toml. I regenerated the tests, with no surprises.
1 parent d496984 commit a97aa12

File tree

4 files changed

+15
-10
lines changed

4 files changed

+15
-10
lines changed

exercises/practice/change/.docs/instructions.md

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,11 @@
11
# Instructions
22

3-
Correctly determine the fewest number of coins to be given to a customer such
4-
that the sum of the coins' value would equal the correct amount of change.
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.
54

65
## For example
76

8-
- An input of 15 with [1, 5, 10, 25, 100] should return one nickel (5)
9-
and one dime (10) or [5, 10]
10-
- An input of 40 with [1, 5, 10, 25, 100] should return one nickel (5)
11-
and one dime (10) and one quarter (25) or [5, 10, 25]
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]
129

1310
## Edge cases
1411

exercises/practice/change/.meta/config.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"blurb": "Correctly determine change to be given using the least number of coins",
2+
"blurb": "Correctly determine change to be given using the least number of coins.",
33
"authors": [
44
"adimasuhid"
55
],

exercises/practice/change/.meta/tests.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@
99
# As user-added comments (using the # character) will be removed when this file
1010
# is regenerated, comments can be added via a `comment` key.
1111

12+
[d0ebd0e1-9d27-4609-a654-df5c0ba1d83a]
13+
description = "change for 1 cent"
14+
1215
[36887bea-7f92-4a9c-b0cc-c0e886b3ecc8]
1316
description = "single coin change"
1417

exercises/practice/change/change_test.rb

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,13 @@
22
require_relative 'change'
33

44
class ChangeTest < Minitest::Test
5-
def test_single_coin_change
5+
def test_change_for_1_cent
66
# skip
7+
assert_equal [1], Change.generate([1, 5, 10, 25], 1)
8+
end
9+
10+
def test_single_coin_change
11+
skip
712
assert_equal [25], Change.generate([1, 5, 10, 25, 100], 25)
813
end
914

@@ -24,8 +29,8 @@ def test_change_with_lower_elbonia_coins
2429

2530
def test_large_target_values
2631
skip
27-
assert_equal [2, 2, 5, 20, 20, 50, 100, 100, 100, 100, 100, 100, 100, 100, 100],
28-
Change.generate([1, 2, 5, 10, 20, 50, 100], 999)
32+
expected = [2, 2, 5, 20, 20, 50, 100, 100, 100, 100, 100, 100, 100, 100, 100]
33+
assert_equal expected, Change.generate([1, 2, 5, 10, 20, 50, 100], 999)
2934
end
3035

3136
def test_possible_change_without_unit_coins_available

0 commit comments

Comments
 (0)