Skip to content

Commit 87cbb6b

Browse files
committed
fix lint errs and upload sol
1 parent 4a7f489 commit 87cbb6b

File tree

2 files changed

+11
-549
lines changed

2 files changed

+11
-549
lines changed

data/course-revision/1511-22T3/scrambled_scrabble.mdx

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,9 @@ Given a string with some spots filled with letters and the others hyphens, and a
1414

1515
The program should receive three lines of input:
1616

17-
1. The first is an integer $N$.
18-
2. Next will be the target word of length $N$, with some letters filled in and hyphens where you insert other letters. You may assume that the target word will always contain at least one letter, i.e you will never be given a target word consisting of all hyphens.
19-
3. Finally will be the letter bank of length $N$ in reverse alphabetical order.
17+
1. The first is an integer N.
18+
2. Next will be the target word of length N, with some letters filled in and hyphens where you insert other letters. You may assume that the target word will always contain at least one letter, i.e you will never be given a target word consisting of all hyphens.
19+
3. Finally will be the letter bank of length N in reverse alphabetical order.
2020

2121
**Output Format**
2222

@@ -25,10 +25,10 @@ If a word can be formed, print to stdout the value of the word. If a word cannot
2525
## Assumptions/Restrictions/Clarifications
2626

2727
- Fortunately, the words we create do not have to be real English words. The bank of letters we are given will also be the same length as the length of word we are trying to create. Note that spots in the target word with hyphens are where we need to put our letters.
28-
- Each letter will have a value corresponding to its position in the alphabet ($a=1$, $b=2$ etc.)
28+
- Each letter will have a value corresponding to its position in the alphabet (a=1, b=2 etc.)
2929
- Each consonant must be followed by a vowel and each vowel must be followed by a consonant. (“abed” is valid, “abcd” is not). Words can start with either a consonant or vowel.
3030
- No letter from the letter bank can be used more than once. Note there may be duplicate letters in the letter bank, you can use both.
31-
- $1 <= N <= 1024$
31+
- 1 ≤ N 1024
3232

3333
The output from your program should look **exactly** like this:
3434

@@ -43,7 +43,7 @@ zyhdcb
4343

4444
**Explanation**
4545

46-
The highest scoring words we can make are “azeciy” or “ayeciz”. Assume we use "azeciy" as our word, then we calculate the score as $1 + 26 + 5 + 3 + 9 + 25 = 69$.
46+
The highest scoring words we can make are “azeciy” or “ayeciz”. Assume we use "azeciy" as our word, then we calculate the score as 1 + 26 + 5 + 3 + 9 + 25 = 69.
4747

4848
```bash:~/1511-revision/scrambled_scrabble
4949
$ ./scrambled_scrabble
@@ -55,4 +55,8 @@ Cannot be done!
5555

5656
**Explanation**
5757

58-
There are 3 spots we need to fill using two vowels and a consonant. There is only one vowel in the letter bank we were given, hence we cannot form a word.
58+
There are 3 spots we need to fill using two vowels and a consonant. There is only one vowel in the letter bank we were given, hence we cannot form a word.
59+
60+
## Solution
61+
62+
You can view the solution code to this problem [here](https://github.com/csesoc/comp1511-revision-t1-2022/blob/master/solutions/scrambled-scrabble/solution.c).

0 commit comments

Comments
 (0)