feat(curriculum): restore seed + solution to Chinese (#40683)

* feat(tools): add seed/solution restore script

* chore(curriculum): remove empty sections' markers

* chore(curriculum): add seed + solution to Chinese

* chore: remove old formatter

* fix: update getChallenges

parse translated challenges separately, without reference to the source

* chore(curriculum): add dashedName to English

* chore(curriculum): add dashedName to Chinese

* refactor: remove unused challenge property 'name'

* fix: relax dashedName requirement

* fix: stray tag

Remove stray `pre` tag from challenge file.

Signed-off-by: nhcarrigan <nhcarrigan@gmail.com>

Co-authored-by: nhcarrigan <nhcarrigan@gmail.com>
This commit is contained in:
Oliver Eyton-Williams
2021-01-13 03:31:00 +01:00
committed by GitHub
parent 0095583028
commit ee1e8abd87
4163 changed files with 57505 additions and 10540 deletions

View File

@ -3,6 +3,7 @@ id: 5900f36e1000cf542c50fe80
title: 问题13和5的倍数
challengeType: 5
videoUrl: ''
dashedName: problem-1-multiples-of-3-and-5
---
# --description--
@ -37,5 +38,30 @@ assert.strictEqual(multiplesOf3and5(19564), 89301183);
assert.strictEqual(multiplesOf3and5(8456), 16687353);
```
# --seed--
## --seed-contents--
```js
function multiplesOf3and5(number) {
return true;
}
multiplesOf3and5(1000);
```
# --solutions--
```js
const multiplesOf3and5 = (number) => {
var total = 0;
for(var i = 0; i < number; i++) {
if(i % 3 == 0 || i % 5 == 0) {
total += i;
}
}
return total;
};
```

View File

@ -3,6 +3,7 @@ id: 5900f3761000cf542c50fe89
title: 问题10素数的总和
challengeType: 5
videoUrl: ''
dashedName: problem-10-summation-of-primes
---
# --description--
@ -35,5 +36,38 @@ assert.strictEqual(primeSummation(140759), 873608362);
assert.strictEqual(primeSummation(2000000), 142913828922);
```
# --seed--
## --seed-contents--
```js
function primeSummation(n) {
return true;
}
primeSummation(2000000);
```
# --solutions--
```js
function primeSummation(n) {
if (n < 3) { return 0 };
let nums = [0, 0, 2];
for (let i = 3; i < n; i += 2){
nums.push(i);
nums.push(0);
}
let sum = 2;
for (let i = 3; i < n; i += 2){
if (nums[i] !== 0){
sum += nums[i];
for (let j = i*i; j < n; j += i){
nums[j] = 0;
}
}
}
return sum;
}
```

View File

@ -3,6 +3,7 @@ id: 5900f3d01000cf542c50fee3
title: 问题100安排概率
challengeType: 5
videoUrl: ''
dashedName: problem-100-arranged-probability
---
# --description--
@ -17,5 +18,21 @@ videoUrl: ''
assert.strictEqual(euler100(), 756872327473);
```
# --seed--
## --seed-contents--
```js
function arrangedProbability() {
return true;
}
arrangedProbability();
```
# --solutions--
```js
// solution required
```

View File

@ -3,6 +3,7 @@ id: 5900f3d21000cf542c50fee4
title: 问题101最佳多项式
challengeType: 5
videoUrl: ''
dashedName: problem-101-optimum-polynomial
---
# --description--
@ -21,5 +22,21 @@ OP1n= 11 1,1,1,1 ...... OP2n= 7n-6 1,8,15...... OP3n
assert.strictEqual(euler101(), 37076114526);
```
# --seed--
## --seed-contents--
```js
function euler101() {
return true;
}
euler101();
```
# --solutions--
```js
// solution required
```

View File

@ -3,6 +3,7 @@ id: 5900f3d21000cf542c50fee5
title: 问题102三角形遏制
challengeType: 5
videoUrl: ''
dashedName: problem-102-triangle-containment
---
# --description--
@ -17,5 +18,21 @@ videoUrl: ''
assert.strictEqual(euler102(), 228);
```
# --seed--
## --seed-contents--
```js
function euler102() {
return true;
}
euler102();
```
# --solutions--
```js
// solution required
```

View File

@ -3,6 +3,7 @@ id: 5900f3d61000cf542c50fee7
title: 问题103特殊子集和最佳
challengeType: 5
videoUrl: ''
dashedName: problem-103-special-subset-sums-optimum
---
# --description--
@ -17,5 +18,21 @@ videoUrl: ''
assert.strictEqual(euler103(), 20313839404245);
```
# --seed--
## --seed-contents--
```js
function euler103() {
return true;
}
euler103();
```
# --solutions--
```js
// solution required
```

View File

@ -3,6 +3,7 @@ id: 5900f3d51000cf542c50fee6
title: 问题104Pandigital Fibonacci结束
challengeType: 5
videoUrl: ''
dashedName: problem-104-pandigital-fibonacci-ends
---
# --description--
@ -17,5 +18,21 @@ Fibonacci序列由递归关系定义Fn = Fn-1 + Fn-2其中F1 = 1且F2 = 1.
assert.strictEqual(euler104(), 329468);
```
# --seed--
## --seed-contents--
```js
function euler104() {
return true;
}
euler104();
```
# --solutions--
```js
// solution required
```

View File

@ -3,6 +3,7 @@ id: 5900f3d61000cf542c50fee8
title: 问题105特殊子集总和测试
challengeType: 5
videoUrl: ''
dashedName: problem-105-special-subset-sums-testing
---
# --description--
@ -17,5 +18,21 @@ videoUrl: ''
assert.strictEqual(euler105(), 73702);
```
# --seed--
## --seed-contents--
```js
function euler105() {
return true;
}
euler105();
```
# --solutions--
```js
// solution required
```

View File

@ -3,6 +3,7 @@ id: 5900f3d71000cf542c50fee9
title: 问题106特殊子集和元测试
challengeType: 5
videoUrl: ''
dashedName: problem-106-special-subset-sums-meta-testing
---
# --description--
@ -17,5 +18,21 @@ videoUrl: ''
assert.strictEqual(euler106(), 21384);
```
# --seed--
## --seed-contents--
```js
function euler106() {
return true;
}
euler106();
```
# --solutions--
```js
// solution required
```

View File

@ -3,6 +3,7 @@ id: 5900f3d91000cf542c50feea
title: 问题107最小网络
challengeType: 5
videoUrl: ''
dashedName: problem-107-minimal-network
---
# --description--
@ -21,5 +22,21 @@ videoUrl: ''
assert.strictEqual(euler107(), 259679);
```
# --seed--
## --seed-contents--
```js
function euler107() {
return true;
}
euler107();
```
# --solutions--
```js
// solution required
```

View File

@ -3,6 +3,7 @@ id: 5900f3d91000cf542c50feeb
title: 问题108丢番图互惠I
challengeType: 5
videoUrl: ''
dashedName: problem-108-diophantine-reciprocals-i
---
# --description--
@ -19,5 +20,21 @@ diophantineOne `diophantineOne()`应返回180180。
assert.strictEqual(diophantineOne(), 180180);
```
# --seed--
## --seed-contents--
```js
function diophantineOne() {
return true;
}
diophantineOne();
```
# --solutions--
```js
// solution required
```

View File

@ -3,6 +3,7 @@ id: 5900f3db1000cf542c50feec
title: 问题109飞镖
challengeType: 5
videoUrl: ''
dashedName: problem-109-darts
---
# --description--
@ -33,5 +34,21 @@ S1 S1 D2 S1 T1 D1 S1 S3 D1 D1 D1 D1 D1 S2 D1 S2 S2 D1
assert.strictEqual(euler109(), 38182);
```
# --seed--
## --seed-contents--
```js
function euler109() {
return true;
}
euler109();
```
# --solutions--
```js
// solution required
```

View File

@ -3,6 +3,7 @@ id: 5900f3781000cf542c50fe8a
title: 问题11网格中最大的产品
challengeType: 5
videoUrl: ''
dashedName: problem-11-largest-product-in-a-grid
---
# --description--
@ -65,5 +66,126 @@ assert.strictEqual(largestGridProduct(grid), 70600674);
assert.strictEqual(largestGridProduct(testGrid), 14169081);
```
# --seed--
## --seed-contents--
```js
function largestGridProduct(arr) {
return true;
}
// Only change code above this line
const grid = [
[8, 2, 22, 97, 38, 15, 0, 40, 0, 75, 4, 5, 7, 78, 52, 12, 50, 77, 91, 8],
[49, 49, 99, 40, 17, 81, 18, 57, 60, 87, 17, 40, 98, 43, 69, 48, 4, 56, 62, 0],
[81, 49, 31, 73, 55, 79, 14, 29, 93, 71, 40, 67, 53, 88, 30, 3, 49, 13, 36, 65],
[52, 70, 95, 23, 4, 60, 11, 42, 69, 24, 68, 56, 1, 32, 56, 71, 37, 2, 36, 91],
[22, 31, 16, 71, 51, 67, 63, 89, 41, 92, 36, 54, 22, 40, 40, 28, 66, 33, 13, 80],
[24, 47, 32, 60, 99, 3, 45, 2, 44, 75, 33, 53, 78, 36, 84, 20, 35, 17, 12, 50],
[32, 98, 81, 28, 64, 23, 67, 10, 26, 38, 40, 67, 59, 54, 70, 66, 18, 38, 64, 70],
[67, 26, 20, 68, 2, 62, 12, 20, 95, 63, 94, 39, 63, 8, 40, 91, 66, 49, 94, 21],
[24, 55, 58, 5, 66, 73, 99, 26, 97, 17, 78, 78, 96, 83, 14, 88, 34, 89, 63, 72],
[21, 36, 23, 9, 75, 0, 76, 44, 20, 45, 35, 14, 0, 61, 33, 97, 34, 31, 33, 95],
[78, 17, 53, 28, 22, 75, 31, 67, 15, 94, 3, 80, 4, 62, 16, 14, 9, 53, 56, 92],
[16, 39, 5, 42, 96, 35, 31, 47, 55, 58, 88, 24, 0, 17, 54, 24, 36, 29, 85, 57],
[86, 56, 0, 48, 35, 71, 89, 7, 5, 44, 44, 37, 44, 60, 21, 58, 51, 54, 17, 58],
[19, 80, 81, 68, 5, 94, 47, 69, 28, 73, 92, 13, 86, 52, 17, 77, 4, 89, 55, 40],
[4, 52, 8, 83, 97, 35, 99, 16, 7, 97, 57, 32, 16, 26, 26, 79, 33, 27, 98, 66],
[88, 36, 68, 87, 57, 62, 20, 72, 3, 46, 33, 67, 46, 55, 12, 32, 63, 93, 53, 69],
[4, 42, 16, 73, 38, 25, 39, 11, 24, 94, 72, 18, 8, 46, 29, 32, 40, 62, 76, 36],
[20, 69, 36, 41, 72, 30, 23, 88, 34, 62, 99, 69, 82, 67, 59, 85, 74, 4, 36, 16],
[20, 73, 35, 29, 78, 31, 90, 1, 74, 31, 49, 71, 48, 86, 81, 16, 23, 57, 5, 54],
[1, 70, 54, 71, 83, 51, 54, 69, 16, 92, 33, 48, 61, 43, 52, 1, 89, 19, 67, 48]
];
const testGrid = [
[40, 17, 81, 18, 57],
[74, 4, 36, 16, 29],
[36, 42, 69, 73, 45],
[51, 54, 69, 16, 92],
[7, 97, 57, 32, 16]
];
largestGridProduct(testGrid);
```
# --solutions--
```js
function largestGridProduct(arr) {
let maxProduct = 0;
let currProduct = 0;
function maxProductChecker(n) {
if (n > maxProduct) {
return maxProduct = n;
}
}
// loop rows
for (let r = 0; r < arr.length; r++) {
// loop columns
for (let c = 0; c < arr[r].length; c++) {
const limit = arr[r].length - 3;
// check horizontal
if (c < limit) {
currProduct = arr[r][c] * arr[r][c + 1] * arr[r][c + 2] * arr[r][c + 3];
maxProductChecker(currProduct);
}
// check vertical
if (r < limit) {
currProduct = arr[r][c] * arr[r + 1][c] * arr[r + 2][c] * arr[r + 3][c];
maxProductChecker(currProduct);
}
// check diagonal [\]
if (c < limit && r < limit) {
currProduct = arr[r][c] * arr[r + 1][c + 1] * arr[r + 2][c + 2] * arr[r + 3][c + 3];
maxProductChecker(currProduct);
}
// check diagonal [/]
if (c > 3 && r < limit) {
currProduct = arr[r][c] * arr[r + 1][c - 1] * arr[r + 2][c - 2] * arr[r + 3][c - 3];
maxProductChecker(currProduct);
}
}
}
return maxProduct;
}
const grid = [ [8, 2, 22, 97, 38, 15, 0, 40, 0, 75, 4, 5, 7, 78, 52, 12, 50, 77, 91, 8],
[49, 49, 99, 40, 17, 81, 18, 57, 60, 87, 17, 40, 98, 43, 69, 48, 4, 56, 62, 0],
[81, 49, 31, 73, 55, 79, 14, 29, 93, 71, 40, 67, 53, 88, 30, 3, 49, 13, 36, 65],
[52, 70, 95, 23, 4, 60, 11, 42, 69, 24, 68, 56, 1, 32, 56, 71, 37, 2, 36, 91],
[22, 31, 16, 71, 51, 67, 63, 89, 41, 92, 36, 54, 22, 40, 40, 28, 66, 33, 13, 80],
[24, 47, 32, 60, 99, 3, 45, 2, 44, 75, 33, 53, 78, 36, 84, 20, 35, 17, 12, 50],
[32, 98, 81, 28, 64, 23, 67, 10, 26, 38, 40, 67, 59, 54, 70, 66, 18, 38, 64, 70],
[67, 26, 20, 68, 2, 62, 12, 20, 95, 63, 94, 39, 63, 8, 40, 91, 66, 49, 94, 21],
[24, 55, 58, 5, 66, 73, 99, 26, 97, 17, 78, 78, 96, 83, 14, 88, 34, 89, 63, 72],
[21, 36, 23, 9, 75, 0, 76, 44, 20, 45, 35, 14, 0, 61, 33, 97, 34, 31, 33, 95],
[78, 17, 53, 28, 22, 75, 31, 67, 15, 94, 3, 80, 4, 62, 16, 14, 9, 53, 56, 92],
[16, 39, 5, 42, 96, 35, 31, 47, 55, 58, 88, 24, 0, 17, 54, 24, 36, 29, 85, 57],
[86, 56, 0, 48, 35, 71, 89, 7, 5, 44, 44, 37, 44, 60, 21, 58, 51, 54, 17, 58],
[19, 80, 81, 68, 5, 94, 47, 69, 28, 73, 92, 13, 86, 52, 17, 77, 4, 89, 55, 40],
[4, 52, 8, 83, 97, 35, 99, 16, 7, 97, 57, 32, 16, 26, 26, 79, 33, 27, 98, 66],
[88, 36, 68, 87, 57, 62, 20, 72, 3, 46, 33, 67, 46, 55, 12, 32, 63, 93, 53, 69],
[4, 42, 16, 73, 38, 25, 39, 11, 24, 94, 72, 18, 8, 46, 29, 32, 40, 62, 76, 36],
[20, 69, 36, 41, 72, 30, 23, 88, 34, 62, 99, 69, 82, 67, 59, 85, 74, 4, 36, 16],
[20, 73, 35, 29, 78, 31, 90, 1, 74, 31, 49, 71, 48, 86, 81, 16, 23, 57, 5, 54],
[1, 70, 54, 71, 83, 51, 54, 69, 16, 92, 33, 48, 61, 43, 52, 1, 89, 19, 67, 48]
];
const testGrid = [
[40, 17, 81, 18, 57],
[74, 4, 36, 16, 29],
[36, 42, 69, 73, 45],
[51, 54, 69, 16, 92],
[7, 97, 57, 32, 16]
];
```

View File

@ -3,6 +3,7 @@ id: 5900f3db1000cf542c50feed
title: 问题110丢番图互惠II
challengeType: 5
videoUrl: ''
dashedName: problem-110-diophantine-reciprocals-ii
---
# --description--
@ -17,5 +18,21 @@ videoUrl: ''
assert.strictEqual(diophantineTwo(), 9350130049860600);
```
# --seed--
## --seed-contents--
```js
function diophantineTwo() {
return true;
}
diophantineTwo();
```
# --solutions--
```js
// solution required
```

View File

@ -3,6 +3,7 @@ id: 5900f3db1000cf542c50feee
title: 问题111运行的Primes
challengeType: 5
videoUrl: ''
dashedName: problem-111-primes-with-runs
---
# --description--
@ -21,5 +22,21 @@ videoUrl: ''
assert.strictEqual(euler111(), 612407567715);
```
# --seed--
## --seed-contents--
```js
function euler111() {
return true;
}
euler111();
```
# --solutions--
```js
// solution required
```

View File

@ -3,6 +3,7 @@ id: 5900f3dd1000cf542c50feef
title: 问题112有弹性的数字
challengeType: 5
videoUrl: ''
dashedName: problem-112-bouncy-numbers
---
# --description--
@ -17,5 +18,21 @@ videoUrl: ''
assert.strictEqual(euler112(), 1587000);
```
# --seed--
## --seed-contents--
```js
function euler112() {
return true;
}
euler112();
```
# --solutions--
```js
// solution required
```

View File

@ -3,6 +3,7 @@ id: 5900f3dd1000cf542c50fef0
title: 问题113非弹性数字
challengeType: 5
videoUrl: ''
dashedName: problem-113-non-bouncy-numbers
---
# --description--
@ -17,5 +18,21 @@ videoUrl: ''
assert.strictEqual(euler113(), 51161058134250);
```
# --seed--
## --seed-contents--
```js
function euler113() {
return true;
}
euler113();
```
# --solutions--
```js
// solution required
```

View File

@ -3,6 +3,7 @@ id: 5900f3e01000cf542c50fef2
title: 问题114计数块组合I
challengeType: 5
videoUrl: ''
dashedName: problem-114-counting-block-combinations-i
---
# --description--
@ -19,5 +20,21 @@ videoUrl: ''
assert.strictEqual(euler114(), 16475640049);
```
# --seed--
## --seed-contents--
```js
function euler114() {
return true;
}
euler114();
```
# --solutions--
```js
// solution required
```

View File

@ -3,6 +3,7 @@ id: 5900f3df1000cf542c50fef1
title: 问题115计数块组合II
challengeType: 5
videoUrl: ''
dashedName: problem-115-counting-block-combinations-ii
---
# --description--
@ -17,5 +18,21 @@ videoUrl: ''
assert.strictEqual(euler115(), 168);
```
# --seed--
## --seed-contents--
```js
function euler115() {
return true;
}
euler115();
```
# --solutions--
```js
// solution required
```

View File

@ -3,6 +3,7 @@ id: 5900f3e01000cf542c50fef3
title: 问题116红色绿色或蓝色瓷砖
challengeType: 5
videoUrl: ''
dashedName: problem-116-red-green-or-blue-tiles
---
# --description--
@ -23,5 +24,21 @@ videoUrl: ''
assert.strictEqual(euler116(), 20492570929);
```
# --seed--
## --seed-contents--
```js
function euler116() {
return true;
}
euler116();
```
# --solutions--
```js
// solution required
```

View File

@ -3,6 +3,7 @@ id: 5900f3e21000cf542c50fef4
title: 问题117红色绿色和蓝色瓷砖
challengeType: 5
videoUrl: ''
dashedName: problem-117-red-green-and-blue-tiles
---
# --description--
@ -19,5 +20,21 @@ videoUrl: ''
assert.strictEqual(euler117(), 100808458960497);
```
# --seed--
## --seed-contents--
```js
function euler117() {
return true;
}
euler117();
```
# --solutions--
```js
// solution required
```

View File

@ -3,6 +3,7 @@ id: 5900f3e21000cf542c50fef5
title: 问题118Pandigital prime set
challengeType: 5
videoUrl: ''
dashedName: problem-118-pandigital-prime-sets
---
# --description--
@ -17,5 +18,21 @@ videoUrl: ''
assert.strictEqual(euler118(), 44680);
```
# --seed--
## --seed-contents--
```js
function euler118() {
return true;
}
euler118();
```
# --solutions--
```js
// solution required
```

View File

@ -3,6 +3,7 @@ id: 5900f3e41000cf542c50fef6
title: 问题119数字功率总和
challengeType: 5
videoUrl: ''
dashedName: problem-119-digit-power-sum
---
# --description--
@ -17,5 +18,21 @@ videoUrl: ''
assert.strictEqual(euler119(), 248155780267521);
```
# --seed--
## --seed-contents--
```js
function euler119() {
return true;
}
euler119();
```
# --solutions--
```js
// solution required
```

View File

@ -3,6 +3,7 @@ id: 5900f3781000cf542c50fe8b
title: 问题12高度可分的三角数
challengeType: 5
videoUrl: ''
dashedName: problem-12-highly-divisible-triangular-number
---
# --description--
@ -61,5 +62,76 @@ divisibleTriangleNumber `divisibleTriangleNumber(500)`应该返回76576500。
assert.strictEqual(divisibleTriangleNumber(500), 76576500);
```
# --seed--
## --seed-contents--
```js
function divisibleTriangleNumber(n) {
return true;
}
divisibleTriangleNumber(500);
```
# --solutions--
```js
function divisibleTriangleNumber(n) {
if (n === 1) return 3;
let counter = 1;
let triangleNumber = counter++;
while (noOfFactors(triangleNumber) < n) {
triangleNumber += counter++;
}
return triangleNumber;
}
function noOfFactors(num) {
const primeFactors = getPrimeFactors(num);
let prod = 1;
for(let p in primeFactors) {
prod *= (primeFactors[p] + 1)
}
return prod;
}
function getPrimeFactors(num) {
let n = num;
let primes = {};
let p = 2;
let sqrt = Math.sqrt(num);
function checkAndUpdate(inc) {
if (n % p === 0) {
const curr = primes[p];
if (curr) {
primes[p]++
} else {
primes[p] = 1;
}
n /= p;
} else {
p += inc;
}
}
while(p === 2 && p <= n) {
checkAndUpdate(1);
}
while (p <= n && p <= sqrt) {
checkAndUpdate(2);
}
if(Object.keys(primes).length === 0) {
primes[num] = 1;
} else if(n !== 1) {
primes[n] = 1;
}
return primes;
}
```

View File

@ -3,6 +3,7 @@ id: 5900f3e41000cf542c50fef7
title: 问题120方形剩余部分
challengeType: 5
videoUrl: ''
dashedName: problem-120-square-remainders
---
# --description--
@ -17,5 +18,21 @@ videoUrl: ''
assert.strictEqual(euler120(), 333082500);
```
# --seed--
## --seed-contents--
```js
function euler120() {
return true;
}
euler120();
```
# --solutions--
```js
// solution required
```

View File

@ -3,6 +3,7 @@ id: 5900f3e51000cf542c50fef8
title: 问题121光盘游戏奖金
challengeType: 5
videoUrl: ''
dashedName: problem-121-disc-game-prize-fund
---
# --description--
@ -17,5 +18,21 @@ videoUrl: ''
assert.strictEqual(euler121(), 2269);
```
# --seed--
## --seed-contents--
```js
function euler121() {
return true;
}
euler121();
```
# --solutions--
```js
// solution required
```

View File

@ -3,6 +3,7 @@ id: 5900f3e61000cf542c50fef9
title: 问题122有效取幂
challengeType: 5
videoUrl: ''
dashedName: problem-122-efficient-exponentiation
---
# --description--
@ -17,5 +18,21 @@ videoUrl: ''
assert.strictEqual(euler122(), 1582);
```
# --seed--
## --seed-contents--
```js
function euler122() {
return true;
}
euler122();
```
# --solutions--
```js
// solution required
```

View File

@ -3,6 +3,7 @@ id: 5900f3e71000cf542c50fefa
title: 问题123素数正方形余数
challengeType: 5
videoUrl: ''
dashedName: problem-123-prime-square-remainders
---
# --description--
@ -17,5 +18,21 @@ videoUrl: ''
assert.strictEqual(euler123(), 21035);
```
# --seed--
## --seed-contents--
```js
function euler123() {
return true;
}
euler123();
```
# --solutions--
```js
// solution required
```

View File

@ -3,6 +3,7 @@ id: 5900f3e81000cf542c50fefb
title: 问题124有序的激进分子
challengeType: 5
videoUrl: ''
dashedName: problem-124-ordered-radicals
---
# --description--
@ -41,5 +42,21 @@ n radnk 11
assert.strictEqual(euler124(), 21417);
```
# --seed--
## --seed-contents--
```js
function euler124() {
return true;
}
euler124();
```
# --solutions--
```js
// solution required
```

View File

@ -3,6 +3,7 @@ id: 5900f3e91000cf542c50fefc
title: 问题125回文总和
challengeType: 5
videoUrl: ''
dashedName: problem-125-palindromic-sums
---
# --description--
@ -17,5 +18,21 @@ videoUrl: ''
assert.strictEqual(euler125(), 2906969179);
```
# --seed--
## --seed-contents--
```js
function euler125() {
return true;
}
euler125();
```
# --solutions--
```js
// solution required
```

View File

@ -3,6 +3,7 @@ id: 5900f3ea1000cf542c50fefd
title: 问题126长方体层
challengeType: 5
videoUrl: ''
dashedName: problem-126-cuboid-layers
---
# --description--
@ -19,5 +20,21 @@ videoUrl: ''
assert.strictEqual(euler126(), 18522);
```
# --seed--
## --seed-contents--
```js
function euler126() {
return true;
}
euler126();
```
# --solutions--
```js
// solution required
```

View File

@ -3,6 +3,7 @@ id: 5900f3ec1000cf542c50fefe
title: 问题127abc-hits
challengeType: 5
videoUrl: ''
dashedName: problem-127-abc-hits
---
# --description--
@ -17,5 +18,21 @@ nradn的基数是n的不同素因子的乘积。例如504 = 23×32×
assert.strictEqual(euler127(), 18407904);
```
# --seed--
## --seed-contents--
```js
function euler127() {
return true;
}
euler127();
```
# --solutions--
```js
// solution required
```

View File

@ -3,6 +3,7 @@ id: 5900f3ec1000cf542c50feff
title: 问题128六边形瓷砖差异
challengeType: 5
videoUrl: ''
dashedName: problem-128-hexagonal-tile-differences
---
# --description--
@ -19,5 +20,21 @@ videoUrl: ''
assert.strictEqual(euler128(), 14516824220);
```
# --seed--
## --seed-contents--
```js
function euler128() {
return true;
}
euler128();
```
# --solutions--
```js
// solution required
```

View File

@ -3,6 +3,7 @@ id: 5900f3ef1000cf542c50ff01
title: 问题129重新划分可分性
challengeType: 5
videoUrl: ''
dashedName: problem-129-repunit-divisibility
---
# --description--
@ -17,5 +18,21 @@ videoUrl: ''
assert.strictEqual(euler129(), 1000023);
```
# --seed--
## --seed-contents--
```js
function euler129() {
return true;
}
euler129();
```
# --solutions--
```js
// solution required
```

View File

@ -3,6 +3,7 @@ id: 5900f37a1000cf542c50fe8c
title: 问题13大笔金额
challengeType: 5
videoUrl: ''
dashedName: problem-13-large-sum
---
# --description--
@ -25,5 +26,154 @@ assert.strictEqual(largeSum(testNums), 8348422521);
assert.strictEqual(largeSum(fiftyDigitNums), 5537376230);
```
# --seed--
## --before-user-code--
```js
const fiftyDigitNums = [
'37107287533902102798797998220837590246510135740250',
'46376937677490009712648124896970078050417018260538',
'74324986199524741059474233309513058123726617309629',
'91942213363574161572522430563301811072406154908250',
'23067588207539346171171980310421047513778063246676',
'89261670696623633820136378418383684178734361726757',
'28112879812849979408065481931592621691275889832738',
'44274228917432520321923589422876796487670272189318',
'47451445736001306439091167216856844588711603153276',
'70386486105843025439939619828917593665686757934951',
'62176457141856560629502157223196586755079324193331',
'64906352462741904929101432445813822663347944758178',
'92575867718337217661963751590579239728245598838407',
'58203565325359399008402633568948830189458628227828',
'80181199384826282014278194139940567587151170094390',
'35398664372827112653829987240784473053190104293586',
'86515506006295864861532075273371959191420517255829',
'71693888707715466499115593487603532921714970056938',
'54370070576826684624621495650076471787294438377604',
'53282654108756828443191190634694037855217779295145',
'36123272525000296071075082563815656710885258350721',
'45876576172410976447339110607218265236877223636045',
'17423706905851860660448207621209813287860733969412',
'81142660418086830619328460811191061556940512689692',
'51934325451728388641918047049293215058642563049483',
'62467221648435076201727918039944693004732956340691',
'15732444386908125794514089057706229429197107928209',
'55037687525678773091862540744969844508330393682126',
'18336384825330154686196124348767681297534375946515',
'80386287592878490201521685554828717201219257766954',
'78182833757993103614740356856449095527097864797581',
'16726320100436897842553539920931837441497806860984',
'48403098129077791799088218795327364475675590848030',
'87086987551392711854517078544161852424320693150332',
'59959406895756536782107074926966537676326235447210',
'69793950679652694742597709739166693763042633987085',
'41052684708299085211399427365734116182760315001271',
'65378607361501080857009149939512557028198746004375',
'35829035317434717326932123578154982629742552737307',
'94953759765105305946966067683156574377167401875275',
'88902802571733229619176668713819931811048770190271',
'25267680276078003013678680992525463401061632866526',
'36270218540497705585629946580636237993140746255962',
'24074486908231174977792365466257246923322810917141',
'91430288197103288597806669760892938638285025333403',
'34413065578016127815921815005561868836468420090470',
'23053081172816430487623791969842487255036638784583',
'11487696932154902810424020138335124462181441773470',
'63783299490636259666498587618221225225512486764533',
'67720186971698544312419572409913959008952310058822',
'95548255300263520781532296796249481641953868218774',
'76085327132285723110424803456124867697064507995236',
'37774242535411291684276865538926205024910326572967',
'23701913275725675285653248258265463092207058596522',
'29798860272258331913126375147341994889534765745501',
'18495701454879288984856827726077713721403798879715',
'38298203783031473527721580348144513491373226651381',
'34829543829199918180278916522431027392251122869539',
'40957953066405232632538044100059654939159879593635',
'29746152185502371307642255121183693803580388584903',
'41698116222072977186158236678424689157993532961922',
'62467957194401269043877107275048102390895523597457',
'23189706772547915061505504953922979530901129967519',
'86188088225875314529584099251203829009407770775672',
'11306739708304724483816533873502340845647058077308',
'82959174767140363198008187129011875491310547126581',
'97623331044818386269515456334926366572897563400500',
'42846280183517070527831839425882145521227251250327',
'55121603546981200581762165212827652751691296897789',
'32238195734329339946437501907836945765883352399886',
'75506164965184775180738168837861091527357929701337',
'62177842752192623401942399639168044983993173312731',
'32924185707147349566916674687634660915035914677504',
'99518671430235219628894890102423325116913619626622',
'73267460800591547471830798392868535206946944540724',
'76841822524674417161514036427982273348055556214818',
'97142617910342598647204516893989422179826088076852',
'87783646182799346313767754307809363333018982642090',
'10848802521674670883215120185883543223812876952786',
'71329612474782464538636993009049310363619763878039',
'62184073572399794223406235393808339651327408011116',
'66627891981488087797941876876144230030984490851411',
'60661826293682836764744779239180335110989069790714',
'85786944089552990653640447425576083659976645795096',
'66024396409905389607120198219976047599490197230297',
'64913982680032973156037120041377903785566085089252',
'16730939319872750275468906903707539413042652315011',
'94809377245048795150954100921645863754710598436791',
'78639167021187492431995700641917969777599028300699',
'15368713711936614952811305876380278410754449733078',
'40789923115535562561142322423255033685442488917353',
'44889911501440648020369068063960672322193204149535',
'41503128880339536053299340368006977710650566631954',
'81234880673210146739058568557934581403627822703280',
'82616570773948327592232845941706525094512325230608',
'22918802058777319719839450180888072429661980811197',
'77158542502016545090413245809786882778948721859617',
'72107838435069186155435662884062257473692284509516',
'20849603980134001723930671666823555245252804609722',
'53503534226472524250874054075591789781264330331690'
];
const testNums = [
'37107287533902102798797998220837590246510135740250',
'46376937677490009712648124896970078050417018260538'
];
```
## --seed-contents--
```js
function largeSum(arr) {
return true;
}
// Only change code above this line
const testNums = [
'37107287533902102798797998220837590246510135740250',
'46376937677490009712648124896970078050417018260538'
];
largeSum(testNums);
```
# --solutions--
```js
function largeSum(arr) {
let sum = 0;
arr.forEach(function(num) {
sum += parseInt(num, 10);
});
sum = sum.toString(10);
sum = sum.substr(0, 1) + sum.substr(2);
let firstTen = sum.slice(0, 10);
return parseInt(firstTen, 10);
}
```

View File

@ -3,6 +3,7 @@ id: 5900f3ee1000cf542c50ff00
title: 问题130具有主要repunit属性的复合材料
challengeType: 5
videoUrl: ''
dashedName: problem-130-composites-with-prime-repunit-property
---
# --description--
@ -17,5 +18,21 @@ videoUrl: ''
assert.strictEqual(euler130(), 149253);
```
# --seed--
## --seed-contents--
```js
function euler130() {
return true;
}
euler130();
```
# --solutions--
```js
// solution required
```

View File

@ -3,6 +3,7 @@ id: 5900f3ef1000cf542c50ff02
title: 问题131Prime立方体伙伴关系
challengeType: 5
videoUrl: ''
dashedName: problem-131-prime-cube-partnership
---
# --description--
@ -17,5 +18,21 @@ videoUrl: ''
assert.strictEqual(euler131(), 173);
```
# --seed--
## --seed-contents--
```js
function euler131() {
return true;
}
euler131();
```
# --solutions--
```js
// solution required
```

View File

@ -3,6 +3,7 @@ id: 5900f3f11000cf542c50ff03
title: 问题132大的重新安置因素
challengeType: 5
videoUrl: ''
dashedName: problem-132-large-repunit-factors
---
# --description--
@ -17,5 +18,21 @@ videoUrl: ''
assert.strictEqual(euler132(), 843296);
```
# --seed--
## --seed-contents--
```js
function euler132() {
return true;
}
euler132();
```
# --solutions--
```js
// solution required
```

View File

@ -3,6 +3,7 @@ id: 5900f3f21000cf542c50ff04
title: 问题133重新计算非因素
challengeType: 5
videoUrl: ''
dashedName: problem-133-repunit-nonfactors
---
# --description--
@ -17,5 +18,21 @@ videoUrl: ''
assert.strictEqual(euler133(), 453647705);
```
# --seed--
## --seed-contents--
```js
function euler133() {
return true;
}
euler133();
```
# --solutions--
```js
// solution required
```

View File

@ -3,6 +3,7 @@ id: 5900f3f21000cf542c50ff05
title: 问题134素对对连接
challengeType: 5
videoUrl: ''
dashedName: problem-134-prime-pair-connection
---
# --description--
@ -17,5 +18,21 @@ videoUrl: ''
assert.strictEqual(euler134(), 18613426663617120);
```
# --seed--
## --seed-contents--
```js
function euler134() {
return true;
}
euler134();
```
# --solutions--
```js
// solution required
```

View File

@ -3,6 +3,7 @@ id: 5900f3f31000cf542c50ff06
title: 问题135同样的差异
challengeType: 5
videoUrl: ''
dashedName: problem-135-same-differences
---
# --description--
@ -17,5 +18,21 @@ videoUrl: ''
assert.strictEqual(euler135(), 4989);
```
# --seed--
## --seed-contents--
```js
function euler135() {
return true;
}
euler135();
```
# --solutions--
```js
// solution required
```

View File

@ -3,6 +3,7 @@ id: 5900f3f51000cf542c50ff07
title: 问题136单身人士差异
challengeType: 5
videoUrl: ''
dashedName: problem-136-singleton-difference
---
# --description--
@ -17,5 +18,21 @@ videoUrl: ''
assert.strictEqual(euler136(), 2544559);
```
# --seed--
## --seed-contents--
```js
function euler136() {
return true;
}
euler136();
```
# --solutions--
```js
// solution required
```

View File

@ -3,6 +3,7 @@ id: 5900f3f51000cf542c50ff08
title: 问题137斐波那契金块
challengeType: 5
videoUrl: ''
dashedName: problem-137-fibonacci-golden-nuggets
---
# --description--
@ -25,5 +26,21 @@ xAFx√2-111/ 22√13-2/ 33√89-5/ 84√34-3/ 55
assert.strictEqual(euler137(), 1120149658760);
```
# --seed--
## --seed-contents--
```js
function euler137() {
return true;
}
euler137();
```
# --solutions--
```js
// solution required
```

View File

@ -3,6 +3,7 @@ id: 5900f3f61000cf542c50ff09
title: 问题138特殊的等腰三角形
challengeType: 5
videoUrl: ''
dashedName: problem-138-special-isosceles-triangles
---
# --description--
@ -19,5 +20,21 @@ videoUrl: ''
assert.strictEqual(euler138(), 1118049290473932);
```
# --seed--
## --seed-contents--
```js
function euler138() {
return true;
}
euler138();
```
# --solutions--
```js
// solution required
```

View File

@ -3,6 +3,7 @@ id: 5900f3f71000cf542c50ff0a
title: 问题139毕达哥拉斯瓷砖
challengeType: 5
videoUrl: ''
dashedName: problem-139-pythagorean-tiles
---
# --description--
@ -19,5 +20,21 @@ videoUrl: ''
assert.strictEqual(euler139(), 10057761);
```
# --seed--
## --seed-contents--
```js
function euler139() {
return true;
}
euler139();
```
# --solutions--
```js
// solution required
```

View File

@ -3,6 +3,7 @@ id: 5900f37a1000cf542c50fe8d
title: 问题14最长的Collatz序列
challengeType: 5
videoUrl: ''
dashedName: problem-14-longest-collatz-sequence
---
# --description--
@ -51,5 +52,44 @@ assert.strictEqual(longestCollatzSequence(54512), 52527);
assert.strictEqual(longestCollatzSequence(100000), 77031);
```
# --seed--
## --seed-contents--
```js
function longestCollatzSequence(limit) {
return true;
}
longestCollatzSequence(14);
```
# --solutions--
```js
function longestCollatzSequence(limit) {
let longest = 1;
let maxLength = 1;
for (let i = Math.floor(limit / 2); i < limit; i++) {
let len = colLen(i);
if (len > maxLength) {
longest = i;
maxLength = len;
}
}
return longest;
}
const knownSequence = { '1': 1 };
function colLen(n) {
if (knownSequence[n]) {
return knownSequence[n];
} else {
const len = n % 2 === 0 ? colLen(n / 2) + 1 : colLen((3 * n + 1) / 2) + 2;
knownSequence[n] = len;
return len;
}
}
```

View File

@ -3,6 +3,7 @@ id: 5900f3fa1000cf542c50ff0c
title: 问题140改进的斐波那契金块
challengeType: 5
videoUrl: ''
dashedName: problem-140-modified-fibonacci-golden-nuggets
---
# --description--
@ -21,5 +22,21 @@ xAGx√5-1/ 41 2/52√22-2/ 63√137-5/ 144 1/25
assert.strictEqual(euler140(), 5673835352990);
```
# --seed--
## --seed-contents--
```js
function euler140() {
return true;
}
euler140();
```
# --solutions--
```js
// solution required
```

View File

@ -3,6 +3,7 @@ id: 5900f3f91000cf542c50ff0b
title: 问题141调查渐进数n它们也是正方形
challengeType: 5
videoUrl: ''
dashedName: problem-141-investigating-progressive-numbers-n-which-are-also-square
---
# --description--
@ -17,5 +18,21 @@ videoUrl: ''
assert.strictEqual(euler141(), 878454337159);
```
# --seed--
## --seed-contents--
```js
function euler141() {
return true;
}
euler141();
```
# --solutions--
```js
// solution required
```

View File

@ -3,6 +3,7 @@ id: 5900f3fa1000cf542c50ff0d
title: 问题142完美的方形集合
challengeType: 5
videoUrl: ''
dashedName: problem-142-perfect-square-collection
---
# --description--
@ -17,5 +18,21 @@ videoUrl: ''
assert.strictEqual(euler142(), 1006193);
```
# --seed--
## --seed-contents--
```js
function euler142() {
return true;
}
euler142();
```
# --solutions--
```js
// solution required
```

View File

@ -3,6 +3,7 @@ id: 5900f3fc1000cf542c50ff0e
title: 问题143研究三角形的Torricelli点
challengeType: 5
videoUrl: ''
dashedName: problem-143-investigating-the-torricelli-point-of-a-triangle
---
# --description--
@ -19,5 +20,21 @@ videoUrl: ''
assert.strictEqual(euler143(), 30758397);
```
# --seed--
## --seed-contents--
```js
function euler143() {
return true;
}
euler143();
```
# --solutions--
```js
// solution required
```

View File

@ -3,6 +3,7 @@ id: 5900f3fc1000cf542c50ff0f
title: 问题144研究激光束的多次反射
challengeType: 5
videoUrl: ''
dashedName: problem-144-investigating-multiple-reflections-of-a-laser-beam
---
# --description--
@ -21,5 +22,21 @@ videoUrl: ''
assert.strictEqual(euler144(), 354);
```
# --seed--
## --seed-contents--
```js
function euler144() {
return true;
}
euler144();
```
# --solutions--
```js
// solution required
```

View File

@ -3,6 +3,7 @@ id: 5900f3fd1000cf542c50ff10
title: 问题145有多少可逆数字低于十亿
challengeType: 5
videoUrl: ''
dashedName: problem-145-how-many-reversible-numbers-are-there-below-one-billion
---
# --description--
@ -21,5 +22,21 @@ videoUrl: ''
assert.strictEqual(euler145(), 608720);
```
# --seed--
## --seed-contents--
```js
function euler145() {
return true;
}
euler145();
```
# --solutions--
```js
// solution required
```

View File

@ -3,6 +3,7 @@ id: 5900f3fe1000cf542c50ff11
title: 问题146调查素数模式
challengeType: 5
videoUrl: ''
dashedName: problem-146-investigating-a-prime-pattern
---
# --description--
@ -19,5 +20,21 @@ videoUrl: ''
assert.strictEqual(euler146(), 676333270);
```
# --seed--
## --seed-contents--
```js
function euler146() {
return true;
}
euler146();
```
# --solutions--
```js
// solution required
```

View File

@ -3,6 +3,7 @@ id: 5900f3ff1000cf542c50ff12
title: 问题147交叉阴影网格中的矩形
challengeType: 5
videoUrl: ''
dashedName: problem-147-rectangles-in-cross-hatched-grids
---
# --description--
@ -23,5 +24,21 @@ videoUrl: ''
assert.strictEqual(euler147(), 846910284);
```
# --seed--
## --seed-contents--
```js
function euler147() {
return true;
}
euler147();
```
# --solutions--
```js
// solution required
```

View File

@ -3,6 +3,7 @@ id: 5900f4021000cf542c50ff14
title: 问题148探索帕斯卡的三角形
challengeType: 5
videoUrl: ''
dashedName: problem-148-exploring-pascals-triangle
---
# --description--
@ -73,5 +74,21 @@ videoUrl: ''
assert.strictEqual(euler148(), 2129970655314432);
```
# --seed--
## --seed-contents--
```js
function euler148() {
return true;
}
euler148();
```
# --solutions--
```js
// solution required
```

View File

@ -3,6 +3,7 @@ id: 5900f4021000cf542c50ff13
title: 问题149搜索最大和子序列
challengeType: 5
videoUrl: ''
dashedName: problem-149-searching-for-a-maximum-sum-subsequence
---
# --description--
@ -31,5 +32,21 @@ videoUrl: ''
assert.strictEqual(euler149(), 52852124);
```
# --seed--
## --seed-contents--
```js
function euler149() {
return true;
}
euler149();
```
# --solutions--
```js
// solution required
```

View File

@ -3,6 +3,7 @@ id: 5900f37b1000cf542c50fe8e
title: 问题15格子路径
challengeType: 5
videoUrl: ''
dashedName: problem-15-lattice-paths
---
# --description--
@ -31,5 +32,29 @@ assert.strictEqual(latticePaths(9), 48620);
assert.strictEqual(latticePaths(20), 137846528820);
```
# --seed--
## --seed-contents--
```js
function latticePaths(gridSize) {
return true;
}
latticePaths(4);
```
# --solutions--
```js
function latticePaths(gridSize) {
let paths = 1;
for (let i = 0; i < gridSize; i++) {
paths *= (2 * gridSize) - i;
paths /= i + 1;
}
return paths;
}
```

View File

@ -3,6 +3,7 @@ id: 5900f4031000cf542c50ff15
title: 问题150在三角形阵列中搜索具有最小和的子三角形
challengeType: 5
videoUrl: ''
dashedName: problem-150-searching-a-triangular-array-for-a-sub-triangle-having-minimum-sum
---
# --description--
@ -33,5 +34,21 @@ s7 s8 s9 s10 ......
assert.strictEqual(euler150(), -271248680);
```
# --seed--
## --seed-contents--
```js
function euler150() {
return true;
}
euler150();
```
# --solutions--
```js
// solution required
```

View File

@ -3,6 +3,7 @@ id: 5900f4031000cf542c50ff16
title: 问题151标准尺寸的纸张期望值问题
challengeType: 5
videoUrl: ''
dashedName: problem-151-paper-sheets-of-standard-sizes-an-expected-value-problem
---
# --description--
@ -19,5 +20,21 @@ videoUrl: ''
assert.strictEqual(euler151(), 0.464399);
```
# --seed--
## --seed-contents--
```js
function euler151() {
return true;
}
euler151();
```
# --solutions--
```js
// solution required
```

View File

@ -3,6 +3,7 @@ id: 5900f4041000cf542c50ff17
title: 问题152将一半写为倒数平方和
challengeType: 5
videoUrl: ''
dashedName: problem-152-writing-one-half-as-a-sum-of-inverse-squares
---
# --description--
@ -21,5 +22,21 @@ videoUrl: ''
assert.strictEqual(euler152(), 301);
```
# --seed--
## --seed-contents--
```js
function euler152() {
return true;
}
euler152();
```
# --solutions--
```js
// solution required
```

View File

@ -3,6 +3,7 @@ id: 5900f4051000cf542c50ff18
title: 问题153调查高斯整数
challengeType: 5
videoUrl: ''
dashedName: problem-153-investigating-gaussian-integers
---
# --description--
@ -49,5 +50,21 @@ divisors111 21,1 + i1-i25 31,34 41,1 + i1-i2,2 + 2i2-2i413 51,
assert.strictEqual(euler153(), 17971254122360636);
```
# --seed--
## --seed-contents--
```js
function euler153() {
return true;
}
euler153();
```
# --solutions--
```js
// solution required
```

View File

@ -3,6 +3,7 @@ id: 5900f4071000cf542c50ff19
title: 问题154探索帕斯卡的金字塔
challengeType: 5
videoUrl: ''
dashedName: problem-154-exploring-pascals-pyramid
---
# --description--
@ -19,5 +20,21 @@ videoUrl: ''
assert.strictEqual(euler154(), 479742450);
```
# --seed--
## --seed-contents--
```js
function euler154() {
return true;
}
euler154();
```
# --solutions--
```js
// solution required
```

View File

@ -3,6 +3,7 @@ id: 5900f4081000cf542c50ff1a
title: 问题155计算电容器电路
challengeType: 5
videoUrl: ''
dashedName: problem-155-counting-capacitor-circuits
---
# --description--
@ -23,5 +24,21 @@ videoUrl: ''
assert.strictEqual(euler155(), 3857447);
```
# --seed--
## --seed-contents--
```js
function euler155() {
return true;
}
euler155();
```
# --solutions--
```js
// solution required
```

View File

@ -3,6 +3,7 @@ id: 5900f4091000cf542c50ff1b
title: 问题156计数数字
challengeType: 5
videoUrl: ''
dashedName: problem-156-counting-digits
---
# --description--
@ -31,5 +32,21 @@ nfn100 11 21 31 41 51 61 71 81 91 102 114 125
assert.strictEqual(euler156(), 21295121502550);
```
# --seed--
## --seed-contents--
```js
function euler156() {
return true;
}
euler156();
```
# --solutions--
```js
// solution required
```

View File

@ -3,6 +3,7 @@ id: 5900f4091000cf542c50ff1c
title: 问题157解决丢番图方程
challengeType: 5
videoUrl: ''
dashedName: problem-157-solving-the-diophantine-equation
---
# --description--
@ -63,5 +64,21 @@ videoUrl: ''
assert.strictEqual(euler157(), 53490);
```
# --seed--
## --seed-contents--
```js
function euler157() {
return true;
}
euler157();
```
# --solutions--
```js
// solution required
```

View File

@ -3,6 +3,8 @@ id: 5900f40a1000cf542c50ff1d
title: 问题158探索在其邻居之后只有一个字符按字典顺序出现的字符串
challengeType: 5
videoUrl: ''
dashedName: >-
problem-158-exploring-strings-for-which-only-one-character-comes-lexicographically-after-its-neighbour-to-the-left
---
# --description--
@ -17,5 +19,21 @@ videoUrl: ''
assert.strictEqual(euler158(), 409511334375);
```
# --seed--
## --seed-contents--
```js
function euler158() {
return true;
}
euler158();
```
# --solutions--
```js
// solution required
```

View File

@ -3,6 +3,7 @@ id: 5900f40c1000cf542c50ff1e
title: 问题159因子的数字根和
challengeType: 5
videoUrl: ''
dashedName: problem-159-digital-root-sums-of-factorisations
---
# --description--
@ -21,5 +22,21 @@ videoUrl: ''
assert.strictEqual(euler159(), 14489159);
```
# --seed--
## --seed-contents--
```js
function euler159() {
return true;
}
euler159();
```
# --solutions--
```js
// solution required
```

View File

@ -3,6 +3,7 @@ id: 5900f37d1000cf542c50fe8f
title: 问题16电源数字总和
challengeType: 5
videoUrl: ''
dashedName: problem-16-power-digit-sum
---
# --description--
@ -29,5 +30,48 @@ assert.strictEqual(powerDigitSum(128), 166);
assert.strictEqual(powerDigitSum(1000), 1366);
```
# --seed--
## --seed-contents--
```js
function powerDigitSum(exponent) {
return true;
}
powerDigitSum(15);
```
# --solutions--
```js
function powerDigitSum(exponent) {
const bigNum = [1];
let sum = 0;
for (let i = 1; i <= exponent; i++) {
let count = bigNum.length + 1;
let overflow = 0;
for (let j = 0; j < count; j++) {
let digit = bigNum[j] || 0;
digit = 2 * digit + overflow;
if (digit > 9) {
digit -= 10;
overflow = 1;
} else {
overflow = 0;
}
bigNum[j] = digit;
}
}
bigNum.forEach(function(num) {
return sum += num;
});
return sum;
}
```

View File

@ -3,6 +3,7 @@ id: 5900f40d1000cf542c50ff1f
title: 问题160因子尾随数字
challengeType: 5
videoUrl: ''
dashedName: problem-160-factorial-trailing-digits
---
# --description--
@ -17,5 +18,21 @@ videoUrl: ''
assert.strictEqual(euler160(), 16576);
```
# --seed--
## --seed-contents--
```js
function euler160() {
return true;
}
euler160();
```
# --solutions--
```js
// solution required
```

View File

@ -3,6 +3,7 @@ id: 5900f40d1000cf542c50ff20
title: 问题161Triominoes
challengeType: 5
videoUrl: ''
dashedName: problem-161-triominoes
---
# --description--
@ -23,5 +24,21 @@ videoUrl: ''
assert.strictEqual(euler161(), 20574308184277972);
```
# --seed--
## --seed-contents--
```js
function euler161() {
return true;
}
euler161();
```
# --solutions--
```js
// solution required
```

View File

@ -3,6 +3,7 @@ id: 5900f40e1000cf542c50ff21
title: 问题162十六进制数
challengeType: 5
videoUrl: ''
dashedName: problem-162-hexadecimal-numbers
---
# --description--
@ -17,5 +18,21 @@ videoUrl: ''
assert.strictEqual(euler162(), '3D58725572C62302');
```
# --seed--
## --seed-contents--
```js
function euler162() {
return true;
}
euler162();
```
# --solutions--
```js
// solution required
```

View File

@ -3,6 +3,7 @@ id: 5900f40f1000cf542c50ff22
title: 问题163阴影线三角形
challengeType: 5
videoUrl: ''
dashedName: problem-163-cross-hatched-triangles
---
# --description--
@ -19,5 +20,21 @@ videoUrl: ''
assert.strictEqual(euler163(), 343047);
```
# --seed--
## --seed-contents--
```js
function euler163() {
return true;
}
euler163();
```
# --solutions--
```js
// solution required
```

View File

@ -3,6 +3,8 @@ id: 5900f4111000cf542c50ff23
title: 问题164没有三个连续数字的总和大于给定值的数字
challengeType: 5
videoUrl: ''
dashedName: >-
problem-164-numbers-for-which-no-three-consecutive-digits-have-a-sum-greater-than-a-given-value
---
# --description--
@ -17,5 +19,21 @@ videoUrl: ''
assert.strictEqual(euler164(), 378158756814587);
```
# --seed--
## --seed-contents--
```js
function euler164() {
return true;
}
euler164();
```
# --solutions--
```js
// solution required
```

View File

@ -3,6 +3,7 @@ id: 5900f4111000cf542c50ff24
title: 问题165交叉口
challengeType: 5
videoUrl: ''
dashedName: problem-165-intersections
---
# --description--
@ -19,5 +20,21 @@ videoUrl: ''
assert.strictEqual(euler165(), 2868868);
```
# --seed--
## --seed-contents--
```js
function euler165() {
return true;
}
euler165();
```
# --solutions--
```js
// solution required
```

View File

@ -3,6 +3,7 @@ id: 5900f4131000cf542c50ff25
title: 问题166克里斯十字架
challengeType: 5
videoUrl: ''
dashedName: problem-166-criss-cross
---
# --description--
@ -25,5 +26,21 @@ videoUrl: ''
assert.strictEqual(euler166(), 7130034);
```
# --seed--
## --seed-contents--
```js
function euler166() {
return true;
}
euler166();
```
# --solutions--
```js
// solution required
```

View File

@ -3,6 +3,7 @@ id: 5900f4141000cf542c50ff26
title: 问题167研究Ulam序列
challengeType: 5
videoUrl: ''
dashedName: problem-167-investigating-ulam-sequences
---
# --description--
@ -17,5 +18,21 @@ videoUrl: ''
assert.strictEqual(euler167(), 3916160068885);
```
# --seed--
## --seed-contents--
```js
function euler167() {
return true;
}
euler167();
```
# --solutions--
```js
// solution required
```

View File

@ -3,6 +3,7 @@ id: 5900f4151000cf542c50ff27
title: 问题168数字轮换
challengeType: 5
videoUrl: ''
dashedName: problem-168-number-rotations
---
# --description--
@ -17,5 +18,21 @@ videoUrl: ''
assert.strictEqual(euler168(), 59206);
```
# --seed--
## --seed-contents--
```js
function euler168() {
return true;
}
euler168();
```
# --solutions--
```js
// solution required
```

View File

@ -3,6 +3,8 @@ id: 5900f4151000cf542c50ff28
title: 问题169探索数字可以表示为2的幂之和的不同方式的数量
challengeType: 5
videoUrl: ''
dashedName: >-
problem-169-exploring-the-number-of-different-ways-a-number-can-be-expressed-as-a-sum-of-powers-of-2
---
# --description--
@ -17,5 +19,21 @@ videoUrl: ''
assert.strictEqual(euler169(), 178653872807);
```
# --seed--
## --seed-contents--
```js
function euler169() {
return true;
}
euler169();
```
# --solutions--
```js
// solution required
```

View File

@ -3,6 +3,7 @@ id: 5900f37d1000cf542c50fe90
title: 问题17数字字母计数
challengeType: 5
videoUrl: ''
dashedName: problem-17-number-letter-counts
---
# --description--
@ -29,5 +30,91 @@ assert.strictEqual(numberLetterCounts(150), 1903);
assert.strictEqual(numberLetterCounts(1000), 21124);
```
# --seed--
## --seed-contents--
```js
function numberLetterCounts(limit) {
return true;
}
numberLetterCounts(5);
```
# --solutions--
```js
function numberLetterCounts(limit) {
const dictionary = {
0: '',
1: 'one',
2: 'two',
3: 'three',
4: 'four',
5: 'five',
6: 'six',
7: 'seven',
8: 'eight',
9: 'nine',
10: 'ten',
11: 'eleven',
12: 'twelve',
13: 'thirteen',
14: 'fourteen',
15: 'fifteen',
16: 'sixteen',
17: 'seventeen',
18: 'eighteen',
19: 'nineteen',
20: 'twenty',
30: 'thirty',
40: 'forty',
50: 'fifty',
60: 'sixty',
70: 'seventy',
80: 'eighty',
90: 'ninety',
1000: 'onethousand'
};
let numString = '';
function convertToString(num) {
// check dictionary for number
if (dictionary[num]) {
return dictionary[num];
} else {
const hundreds = Math.floor(num / 100);
const tens = Math.floor((num / 10) % 10) * 10;
const remainder = num % 10;
let tempStr = '';
if (hundreds === 0) {
tempStr += dictionary[tens] + dictionary[remainder];
} else {
tempStr += dictionary[hundreds] + 'hundred';
if (tens !== 0 || remainder !== 0) {
tempStr += 'and';
}
if (tens < 20) {
const lessThanTwenty = tens + remainder;
tempStr += dictionary[lessThanTwenty];
} else {
tempStr += dictionary[tens] + dictionary[remainder];
}
}
return tempStr;
}
}
for (let i = 1; i <= limit; i++) {
numString += convertToString(i);
}
return numString.length;
}
```

View File

@ -3,6 +3,8 @@ id: 5900f4161000cf542c50ff29
title: 问题170找到可以通过连接产品形成的最大的0到9个pandigital
challengeType: 5
videoUrl: ''
dashedName: >-
problem-170-find-the-largest-0-to-9-pandigital-that-can-be-formed-by-concatenating-products
---
# --description--
@ -25,5 +27,21 @@ videoUrl: ''
assert.strictEqual(euler170(), 9857164023);
```
# --seed--
## --seed-contents--
```js
function euler170() {
return true;
}
euler170();
```
# --solutions--
```js
// solution required
```

View File

@ -3,6 +3,8 @@ id: 5900f4181000cf542c50ff2a
title: 问题171找到数字的平方和为正方形的数字
challengeType: 5
videoUrl: ''
dashedName: >-
problem-171-finding-numbers-for-which-the-sum-of-the-squares-of-the-digits-is-a-square
---
# --description--
@ -17,5 +19,21 @@ videoUrl: ''
assert.strictEqual(euler171(), 142989277);
```
# --seed--
## --seed-contents--
```js
function euler171() {
return true;
}
euler171();
```
# --solutions--
```js
// solution required
```

View File

@ -3,6 +3,7 @@ id: 5900f4181000cf542c50ff2b
title: 问题172调查重复数字很少的数字
challengeType: 5
videoUrl: ''
dashedName: problem-172-investigating-numbers-with-few-repeated-digits
---
# --description--
@ -17,5 +18,21 @@ videoUrl: ''
assert.strictEqual(euler172(), 227485267000992000);
```
# --seed--
## --seed-contents--
```js
function euler172() {
return true;
}
euler172();
```
# --solutions--
```js
// solution required
```

View File

@ -3,6 +3,8 @@ id: 5900f41a1000cf542c50ff2c
title: 问题173使用多达一百万个瓷砖可以形成多少个不同的“空心”方形薄片
challengeType: 5
videoUrl: ''
dashedName: >-
problem-173-using-up-to-one-million-tiles-how-many-different-hollow-square-laminae-can-be-formed
---
# --description--
@ -19,5 +21,21 @@ videoUrl: ''
assert.strictEqual(euler173(), 1572729);
```
# --seed--
## --seed-contents--
```js
function euler173() {
return true;
}
euler173();
```
# --solutions--
```js
// solution required
```

View File

@ -3,6 +3,8 @@ id: 5900f41a1000cf542c50ff2d
title: 问题174计算可以形成一个两个三个......不同排列的“空心”方形薄片的数量
challengeType: 5
videoUrl: ''
dashedName: >-
problem-174-counting-the-number-of-hollow-square-laminae-that-can-form-one-two-three-----distinct-arrangements
---
# --description--
@ -19,5 +21,21 @@ videoUrl: ''
assert.strictEqual(euler174(), 209566);
```
# --seed--
## --seed-contents--
```js
function euler174() {
return true;
}
euler174();
```
# --solutions--
```js
// solution required
```

View File

@ -3,6 +3,8 @@ id: 5900f41c1000cf542c50ff2e
title: 问题175涉及不同方式的数量的分数数字可以表示为2的幂的总和
challengeType: 5
videoUrl: ''
dashedName: >-
problem-175-fractions-involving-the-number-of-different-ways-a-number-can-be-expressed-as-a-sum-of-powers-of-2
---
# --description--
@ -21,5 +23,21 @@ videoUrl: ''
assert.strictEqual(euler175(), 1, 13717420, 8);
```
# --seed--
## --seed-contents--
```js
function euler175() {
return true;
}
euler175();
```
# --solutions--
```js
// solution required
```

View File

@ -3,6 +3,7 @@ id: 5900f41c1000cf542c50ff2f
title: 问题176共用一个cathetus的直角三角形
challengeType: 5
videoUrl: ''
dashedName: problem-176-right-angled-triangles-that-share-a-cathetus
---
# --description--
@ -17,5 +18,21 @@ videoUrl: ''
assert.strictEqual(euler176(), 96818198400000);
```
# --seed--
## --seed-contents--
```js
function euler176() {
return true;
}
euler176();
```
# --solutions--
```js
// solution required
```

View File

@ -3,6 +3,7 @@ id: 5900f41e1000cf542c50ff30
title: 问题177整数角四边形
challengeType: 5
videoUrl: ''
dashedName: problem-177-integer-angled-quadrilaterals
---
# --description--
@ -19,5 +20,21 @@ videoUrl: ''
assert.strictEqual(euler177(), 129325);
```
# --seed--
## --seed-contents--
```js
function euler177() {
return true;
}
euler177();
```
# --solutions--
```js
// solution required
```

View File

@ -3,6 +3,7 @@ id: 5900f41e1000cf542c50ff31
title: 问题178步骤编号
challengeType: 5
videoUrl: ''
dashedName: problem-178-step-numbers
---
# --description--
@ -19,5 +20,21 @@ videoUrl: ''
assert.strictEqual(euler178(), 126461847755);
```
# --seed--
## --seed-contents--
```js
function euler178() {
return true;
}
euler178();
```
# --solutions--
```js
// solution required
```

View File

@ -3,6 +3,7 @@ id: 5900f41f1000cf542c50ff32
title: 问题179连续的正向除数
challengeType: 5
videoUrl: ''
dashedName: problem-179-consecutive-positive-divisors
---
# --description--
@ -17,5 +18,21 @@ videoUrl: ''
assert.strictEqual(euler179(), 986262);
```
# --seed--
## --seed-contents--
```js
function euler179() {
return true;
}
euler179();
```
# --solutions--
```js
// solution required
```

View File

@ -3,6 +3,7 @@ id: 5900f37e1000cf542c50fe91
title: 问题18最大路径总和I.
challengeType: 5
videoUrl: ''
dashedName: problem-18-maximum-path-sum-i
---
# --description--
@ -40,5 +41,51 @@ assert.strictEqual(maximumPathSumI(testTriangle), 23);
assert.strictEqual(maximumPathSumI(numTriangle), 1074);
```
# --seed--
## --before-user-code--
```js
const numTriangle = [[75, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [95, 64, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [17, 47, 82, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [18, 35, 87, 10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [20, 4, 82, 47, 65, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [19, 1, 23, 75, 3, 34, 0, 0, 0, 0, 0, 0, 0, 0, 0], [88, 2, 77, 73, 7, 63, 67, 0, 0, 0, 0, 0, 0, 0, 0], [99, 65, 4, 28, 6, 16, 70, 92, 0, 0, 0, 0, 0, 0, 0], [41, 41, 26, 56, 83, 40, 80, 70, 33, 0, 0, 0, 0, 0, 0], [41, 48, 72, 33, 47, 32, 37, 16, 94, 29, 0, 0, 0, 0, 0], [53, 71, 44, 65, 25, 43, 91, 52, 97, 51, 14, 0, 0, 0, 0], [70, 11, 33, 28, 77, 73, 17, 78, 39, 68, 17, 57, 0, 0, 0], [91, 71, 52, 38, 17, 14, 91, 43, 58, 50, 27, 29, 48, 0, 0], [63, 66, 4, 68, 89, 53, 67, 30, 73, 16, 69, 87, 40, 31, 0], [4, 62, 98, 27, 23, 9, 70, 98, 73, 93, 38, 53, 60, 4, 23]];
```
## --seed-contents--
```js
function maximumPathSumI(triangle) {
return true;
}
const testTriangle = [[3, 0, 0, 0],
[7, 4, 0, 0],
[2, 4, 6, 0],
[8, 5, 9, 3]];
maximumPathSumI(testTriangle);
```
# --solutions--
```js
const testTriangle = [[3, 0, 0, 0],
[7, 4, 0, 0],
[2, 4, 6, 0],
[8, 5, 9, 3]];
function maximumPathSumI(triangle) {
let maxSum = triangle.slice();
for (let i = triangle.length - 1; i > 0; i--) {
let currentRow = maxSum[i];
let previousRow = maxSum[i - 1];
const temp = [];
for (let j = 0; j < i; j++) {
temp.push(Math.max((currentRow[j] + previousRow[j]), (currentRow[j + 1] + previousRow[j])));
}
maxSum[i - 1] = temp;
maxSum.pop();
}
return maxSum[0][0];
}
```

View File

@ -3,6 +3,7 @@ id: 5900f4201000cf542c50ff33
title: 问题180三个变量函数的有理零点
challengeType: 5
videoUrl: ''
dashedName: problem-180-rational-zeros-of-a-function-of-three-variables
---
# --description--
@ -17,5 +18,21 @@ videoUrl: ''
assert.strictEqual(euler180(), 285196020571078980);
```
# --seed--
## --seed-contents--
```js
function euler180() {
return true;
}
euler180();
```
# --solutions--
```js
// solution required
```

View File

@ -3,6 +3,8 @@ id: 5900f4231000cf542c50ff34
title: 问题181调查两种不同颜色的对象可以分组的方式
challengeType: 5
videoUrl: ''
dashedName: >-
problem-181-investigating-in-how-many-ways-objects-of-two-different-colours-can-be-grouped
---
# --description--
@ -17,5 +19,21 @@ videoUrl: ''
assert.strictEqual(euler181(), 83735848679360670);
```
# --seed--
## --seed-contents--
```js
function euler181() {
return true;
}
euler181();
```
# --solutions--
```js
// solution required
```

View File

@ -3,6 +3,7 @@ id: 5900f4231000cf542c50ff35
title: 'Problem 182: RSA encryption'
challengeType: 5
forumTopicId: 301818
dashedName: problem-182-rsa-encryption
---
# --description--

View File

@ -3,6 +3,7 @@ id: 5900f4231000cf542c50ff36
title: 问题183零件的最大产品
challengeType: 5
videoUrl: ''
dashedName: problem-183-maximum-product-of-parts
---
# --description--
@ -31,5 +32,21 @@ videoUrl: ''
assert.strictEqual(euler183(), 48861552);
```
# --seed--
## --seed-contents--
```js
function euler183() {
return true;
}
euler183();
```
# --solutions--
```js
// solution required
```

View File

@ -3,6 +3,7 @@ id: 5900f4241000cf542c50ff37
title: 问题184包含原点的三角形
challengeType: 5
videoUrl: ''
dashedName: problem-184-triangles-containing-the-origin
---
# --description--
@ -21,5 +22,21 @@ videoUrl: ''
assert.strictEqual(euler184(), 1725323624056);
```
# --seed--
## --seed-contents--
```js
function euler184() {
return true;
}
euler184();
```
# --solutions--
```js
// solution required
```

View File

@ -3,6 +3,7 @@ id: 5900f4251000cf542c50ff38
title: 问题185数字思维
challengeType: 5
videoUrl: ''
dashedName: problem-185-number-mind
---
# --description--
@ -25,5 +26,21 @@ videoUrl: ''
assert.strictEqual(euler185(), 4640261571849533);
```
# --seed--
## --seed-contents--
```js
function euler185() {
return true;
}
euler185();
```
# --solutions--
```js
// solution required
```

View File

@ -3,6 +3,7 @@ id: 5900f4281000cf542c50ff39
title: 问题186网络的连通性
challengeType: 5
videoUrl: ''
dashedName: problem-186-connectedness-of-a-network
---
# --description--
@ -27,5 +28,21 @@ RecNrCallerCalled120000710005326001835004393600863701497 .........来电者的
assert.strictEqual(euler186(), 2325629);
```
# --seed--
## --seed-contents--
```js
function euler186() {
return true;
}
euler186();
```
# --solutions--
```js
// solution required
```

View File

@ -3,6 +3,7 @@ id: 5900f4291000cf542c50ff3a
title: 问题187半致
challengeType: 5
videoUrl: ''
dashedName: problem-187-semiprimes
---
# --description--
@ -21,5 +22,21 @@ videoUrl: ''
assert.strictEqual(euler187(), 17427258);
```
# --seed--
## --seed-contents--
```js
function euler187() {
return true;
}
euler187();
```
# --solutions--
```js
// solution required
```

View File

@ -3,6 +3,7 @@ id: 5900f4291000cf542c50ff3b
title: 问题188数字的过度扩展
challengeType: 5
videoUrl: ''
dashedName: problem-188-the-hyperexponentiation-of-a-number
---
# --description--
@ -19,5 +20,21 @@ videoUrl: ''
assert.strictEqual(euler188(), 95962097);
```
# --seed--
## --seed-contents--
```js
function euler188() {
return true;
}
euler188();
```
# --solutions--
```js
// solution required
```

View File

@ -3,6 +3,7 @@ id: 5900f4291000cf542c50ff3c
title: 问题189三角网格三色
challengeType: 5
videoUrl: ''
dashedName: problem-189-tri-colouring-a-triangular-grid
---
# --description--
@ -25,5 +26,21 @@ videoUrl: ''
assert.strictEqual(euler189(), 10834893628237824);
```
# --seed--
## --seed-contents--
```js
function euler189() {
return true;
}
euler189();
```
# --solutions--
```js
// solution required
```

Some files were not shown because too many files have changed in this diff Show More