Skip to content

Commit 0443b28

Browse files
authored
Synced docs for Killer-Sudoku-Helper and Matching-Brackets. (#3724)
1 parent 16adf4e commit 0443b28

File tree

3 files changed

+35
-4
lines changed

3 files changed

+35
-4
lines changed

exercises/practice/killer-sudoku-helper/.docs/instructions.md

Lines changed: 25 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,17 @@ In a 3-digit cage with a sum of 7, there is only one valid combination: 124.
2020
- 1 + 2 + 4 = 7
2121
- Any other combination that adds up to 7, e.g. 232, would violate the rule of not repeating digits within a cage.
2222

23-
![Sudoku grid, with three killer cages that are marked as grouped together. The first killer cage is in the 3×3 box in the top left corner of the grid. The middle column of that box forms the cage, with the followings cells from top to bottom: first cell contains a 1 and a pencil mark of 7, indicating a cage sum of 7, second cell contains a 2, third cell contains a 5. The numbers are highlighted in red to indicate a mistake. The second killer cage is in the central 3×3 box of the grid. The middle column of that box forms the cage, with the followings cells from top to bottom: first cell contains a 1 and a pencil mark of 7, indicating a cage sum of 7, second cell contains a 2, third cell contains a 4. None of the numbers in this cage are highlighted and therefore don't contain any mistakes. The third killer cage follows the outside corner of the central 3×3 box of the grid. It is made up of the following three cells: the top left cell of the cage contains a 2, highlighted in red, and a cage sum of 7. The top right cell of the cage contains a 3. The bottom right cell of the cage contains a 2, highlighted in red. All other cells are empty.][one-solution-img]
23+
![Sudoku grid, with three killer cages that are marked as grouped together.
24+
The first killer cage is in the 3×3 box in the top left corner of the grid.
25+
The middle column of that box forms the cage, with the followings cells from top to bottom: first cell contains a 1 and a pencil mark of 7, indicating a cage sum of 7, second cell contains a 2, third cell contains a 5.
26+
The numbers are highlighted in red to indicate a mistake.
27+
The second killer cage is in the central 3×3 box of the grid.
28+
The middle column of that box forms the cage, with the followings cells from top to bottom: first cell contains a 1 and a pencil mark of 7, indicating a cage sum of 7, second cell contains a 2, third cell contains a 4.
29+
None of the numbers in this cage are highlighted and therefore don't contain any mistakes.
30+
The third killer cage follows the outside corner of the central 3×3 box of the grid.
31+
It is made up of the following three cells: the top left cell of the cage contains a 2, highlighted in red, and a cage sum of 7.
32+
The top right cell of the cage contains a 3.
33+
The bottom right cell of the cage contains a 2, highlighted in red. All other cells are empty.][one-solution-img]
2434

2535
## Example 2: Cage with several combinations
2636

@@ -31,7 +41,13 @@ In a 2-digit cage with a sum 10, there are 4 possible combinations:
3141
- 37
3242
- 46
3343

34-
![Sudoku grid, all squares empty except for the middle column, column 5, which has 8 rows filled. Each continguous two rows form a killer cage and are marked as grouped together. From top to bottom: first group is a cell with value 1 and a pencil mark indicating a cage sum of 10, cell with value 9. Second group is a cell with value 2 and a pencil mark of 10, cell with value 8. Third group is a cell with value 3 and a pencil mark of 10, cell with value 7. Fourth group is a cell with value 4 and a pencil mark of 10, cell with value 6. The last cell in the column is empty.][four-solutions-img]
44+
![Sudoku grid, all squares empty except for the middle column, column 5, which has 8 rows filled.
45+
Each continguous two rows form a killer cage and are marked as grouped together.
46+
From top to bottom: first group is a cell with value 1 and a pencil mark indicating a cage sum of 10, cell with value 9.
47+
Second group is a cell with value 2 and a pencil mark of 10, cell with value 8.
48+
Third group is a cell with value 3 and a pencil mark of 10, cell with value 7.
49+
Fourth group is a cell with value 4 and a pencil mark of 10, cell with value 6.
50+
The last cell in the column is empty.][four-solutions-img]
3551

3652
## Example 3: Cage with several combinations that is restricted
3753

@@ -42,7 +58,13 @@ In a 2-digit cage with a sum 10, where the column already contains a 1 and a 4,
4258

4359
19 and 46 are not possible due to the 1 and 4 in the column according to standard Sudoku rules.
4460

45-
![Sudoku grid, all squares empty except for the middle column, column 5, which has 8 rows filled. The first row contains a 4, the second is empty, and the third contains a 1. The 1 is highlighted in red to indicate a mistake. The last 6 rows in the column form killer cages of two cells each. From top to bottom: first group is a cell with value 2 and a pencil mark indicating a cage sum of 10, cell with value 8. Second group is a cell with value 3 and a pencil mark of 10, cell with value 7. Third group is a cell with value 1, highlighted in red, and a pencil mark of 10, cell with value 9.][not-possible-img]
61+
![Sudoku grid, all squares empty except for the middle column, column 5, which has 8 rows filled.
62+
The first row contains a 4, the second is empty, and the third contains a 1.
63+
The 1 is highlighted in red to indicate a mistake.
64+
The last 6 rows in the column form killer cages of two cells each.
65+
From top to bottom: first group is a cell with value 2 and a pencil mark indicating a cage sum of 10, cell with value 8.
66+
Second group is a cell with value 3 and a pencil mark of 10, cell with value 7.
67+
Third group is a cell with value 1, highlighted in red, and a pencil mark of 10, cell with value 9.][not-possible-img]
4668

4769
## Trying it yourself
4870

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
# Instructions
22

33
Given a string containing brackets `[]`, braces `{}`, parentheses `()`, or any combination thereof, verify that any and all pairs are matched and nested correctly.
4-
The string may also contain other characters, which for the purposes of this exercise should be ignored.
4+
Any other characters should be ignored.
5+
For example, `"{what is (42)}?"` is balanced and `"[text}"` is not.
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# Introduction
2+
3+
You're given the opportunity to write software for the Bracketeer™, an ancient but powerful mainframe.
4+
The software that runs on it is written in a proprietary language.
5+
Much of its syntax is familiar, but you notice _lots_ of brackets, braces and parentheses.
6+
Despite the Bracketeer™ being powerful, it lacks flexibility.
7+
If the source code has any unbalanced brackets, braces or parentheses, the Bracketeer™ crashes and must be rebooted.
8+
To avoid such a scenario, you start writing code that can verify that brackets, braces, and parentheses are balanced before attempting to run it on the Bracketeer™.

0 commit comments

Comments
 (0)