Skip to content

Commit 376b3ba

Browse files
committed
chore: update note
1 parent 99c10a0 commit 376b3ba

File tree

3 files changed

+6
-4
lines changed

3 files changed

+6
-4
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,4 @@ dist/
55
*.zip
66
*.rar
77
*.tgz
8+
src/**/*.js

src/2024/2024-12-07/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ Visit the Advent of Code website for more information on this puzzle at:
88
## Code
99

1010
1. **totalCalibration.ts**
11-
- `operatorCombinations()` - Finds the total number of possible combinations in which to place operator symbols for an `N`-length array
11+
- `operatorCombinations()` - Finds the possible combinations in which to place operator symbols for an `N`-length array
1212

1313
- `doEquation()` - Returns the result of an AoC text equation and a set of operator symbols with the condition: left to write equation processing, disregarding operator precedence
1414

src/2024/2024-12-07/lib/totalCalibration.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
/**
2-
* Finds the total number of possible combinations in which to place operator symbols for an `N`-length array
2+
* Finds the possible combinations in which to place operator symbols for an `N`-length array
33
* @param {string[]} operators String array containing operator symbols
44
* @param {number} N Length of a linear array
5-
* @returns {number} Total number
5+
* @returns {string[][]} List (2D-string array) of possible operators placement combinations
66
*/
77
const operatorCombinations = (
88
operators: string[] = ['+', '*'],
99
N: number
10-
) => {
10+
): string[][] => {
1111
const combinations: string[][] = []
1212
const totalCombinations = Math.pow(operators.length, N)
1313

@@ -62,6 +62,7 @@ export const totalCalibrationResult = (input: string[]): number => {
6262
const line = input[i]
6363

6464
if (line === undefined) break
65+
6566
const [targetSum, data] = line.split(': ')
6667
const numbers = data?.split(' ').map(Number) as number[]
6768

0 commit comments

Comments
 (0)