mirror of
https://github.com/TheAlgorithms/JavaScript.git
synced 2025-12-19 06:58:15 +08:00
fixed some spellings
This commit is contained in:
@@ -33,12 +33,12 @@ const getCollatzSequenceLength = (num, seqLength) => {
|
||||
|
||||
const findLongestCollatzSequence = () => {
|
||||
let startingPointForLargestSequence = 1
|
||||
let largestSequnceLength = 1
|
||||
let largestSequenceLength = 1
|
||||
for (let i = 2; i < 1000000; i++) {
|
||||
const currentSequenceLength = getCollatzSequenceLength(i, 1)
|
||||
if (currentSequenceLength > largestSequnceLength) {
|
||||
if (currentSequenceLength > largestSequenceLength) {
|
||||
startingPointForLargestSequence = i
|
||||
largestSequnceLength = currentSequenceLength
|
||||
largestSequenceLength = currentSequenceLength
|
||||
}
|
||||
}
|
||||
return startingPointForLargestSequence
|
||||
|
||||
Reference in New Issue
Block a user