chore: update tests to use specific asserts in project euler problems 11-20 (#60763)

This commit is contained in:
zenocross
2025-06-08 04:00:49 +08:00
committed by GitHub
parent bbda50ed0d
commit 90bac7239d
10 changed files with 10 additions and 10 deletions
@@ -42,7 +42,7 @@ What is the greatest product of four adjacent numbers in the same direction (up,
`largestGridProduct(testGrid)` should return a number.
```js
assert(typeof largestGridProduct(testGrid) === 'number');
assert.isNumber(largestGridProduct(testGrid));
```
`largestGridProduct(testGrid)` should return 14169081.
@@ -31,7 +31,7 @@ What is the value of the first triangle number to have over `n` divisors?
`divisibleTriangleNumber(5)` should return a number.
```js
assert(typeof divisibleTriangleNumber(5) === 'number');
assert.isNumber(divisibleTriangleNumber(5));
```
`divisibleTriangleNumber(5)` should return 28.
@@ -118,7 +118,7 @@ Work out the first ten digits of the sum of the following one-hundred 50-digit n
`largeSum(testNums)` should return a number.
```js
assert(typeof largeSum(testNums) === 'number');
assert.isNumber(largeSum(testNums));
```
`largeSum(testNums)` should return 8348422521.
@@ -29,7 +29,7 @@ Which starting number, under the given `limit`, produces the longest chain?
`longestCollatzSequence(14)` should return a number.
```js
assert(typeof longestCollatzSequence(14) === 'number');
assert.isNumber(longestCollatzSequence(14));
```
`longestCollatzSequence(14)` should return 9.
@@ -19,7 +19,7 @@ How many such routes are there through a given `gridSize`?
`latticePaths(4)` should return a number.
```js
assert(typeof latticePaths(4) === 'number');
assert.isNumber(latticePaths(4));
```
`latticePaths(4)` should return 70.
@@ -17,7 +17,7 @@ What is the sum of the digits of the number 2<sup><code>exponent</code></sup>?
`powerDigitSum(15)` should return a number.
```js
assert(typeof powerDigitSum(15) === 'number');
assert.isNumber(powerDigitSum(15));
```
`powerDigitSum(15)` should return 26.
@@ -19,7 +19,7 @@ If all the numbers from 1 to given `limit` inclusive were written out in words,
`numberLetterCounts(5)` should return a number.
```js
assert(typeof numberLetterCounts(5) === 'number');
assert.isNumber(numberLetterCounts(5));
```
`numberLetterCounts(5)` should return 19.
@@ -44,7 +44,7 @@ Find the maximum total from top to bottom of the triangle below:
`maximumPathSumI([[3, 0, 0, 0], [7, 4, 0, 0],[2, 4, 6, 0],[8, 5, 9, 3]])` should return a number.
```js
assert(typeof maximumPathSumI(_testTriangle) === 'number');
assert.isNumber(maximumPathSumI(_testTriangle));
```
`maximumPathSumI([[3, 0, 0, 0], [7, 4, 0, 0],[2, 4, 6, 0],[8, 5, 9, 3]])` should return 23.
@@ -23,7 +23,7 @@ How many Sundays fell on the first of the month during the twentieth century (1
`countingSundays(1943, 1946)` should return a number.
```js
assert(typeof countingSundays(1943, 1946) === 'number');
assert.isNumber(countingSundays(1943, 1946));
```
`countingSundays(1943, 1946)` should return 6.
@@ -20,7 +20,7 @@ Find the sum of the digits `n`!
`sumFactorialDigits(10)` should return a number.
```js
assert(typeof sumFactorialDigits(10) === 'number');
assert.isNumber(sumFactorialDigits(10));
```
`sumFactorialDigits(10)` should return 27.