docs: fix typos (#1283)

* docs: fix typos

* fix
This commit is contained in:
Lioness100
2023-02-07 08:50:28 -08:00
committed by GitHub
parent 8cd86b1eda
commit 002b10a5aa
24 changed files with 47 additions and 47 deletions

View File

@ -1,18 +1,18 @@
// https://projecteuler.net/problem=3
export const largestPrime = (num = 600851475143) => {
let newnumm = num
let newnum = num
let largestFact = 0
let counter = 2
while (counter * counter <= newnumm) {
if (newnumm % counter === 0) {
newnumm = newnumm / counter
while (counter * counter <= newnum) {
if (newnum % counter === 0) {
newnum = newnum / counter
} else {
counter++
}
}
if (newnumm > largestFact) {
largestFact = newnumm
if (newnum > largestFact) {
largestFact = newnum
}
return largestFact
}

View File

@ -2,11 +2,11 @@
const largestAdjacentNumber = (grid, consecutive) => {
grid = grid.split('\n').join('')
const splitedGrid = grid.split('\n')
const splitGrid = grid.split('\n')
let largestProd = 0
for (const row in splitedGrid) {
const currentRow = splitedGrid[row].split('').map(x => Number(x))
for (const row in splitGrid) {
const currentRow = splitGrid[row].split('').map(x => Number(x))
for (let i = 0; i < currentRow.length - consecutive; i++) {
const combine = currentRow.slice(i, i + consecutive)

View File

@ -14,7 +14,7 @@
*/
/**
* collect the abundant numbers, generate and store their sums with each other, and check for numbers not in the llst of sums, adds them and returns their sum.
* collect the abundant numbers, generate and store their sums with each other, and check for numbers not in the list of sums, adds them and returns their sum.
* @param {number} [n = 28123]
* @returns {number}
*/

View File

@ -40,7 +40,7 @@ function problem28 (dim) {
* Third corner: i^2 - 2 * (i - 1)
* Fourth corner: i^2 - 3 * (i - 1)
*
* Doing the sum of each corner and simplifing, we found that the result for each dimension is:
* Doing the sum of each corner and simplifying, we found that the result for each dimension is:
* sumDim = 4 * i^2 + 6 * (1 - i)
*
* In this case I skip the 1x1 dim matrix because is trivial, that's why I start in a 3x3 matrix