diff --git a/snippets/arithmeticProgression.md b/snippets/arithmeticProgression.md index aab41ce2f..6ac182b3f 100644 --- a/snippets/arithmeticProgression.md +++ b/snippets/arithmeticProgression.md @@ -1,6 +1,6 @@ --- title: arithmeticProgression -tags: math,beginner +tags: math,algorithm,beginner --- Creates an array of numbers in the arithmetic progression, starting with the given positive integer and up to the specified limit. @@ -8,7 +8,7 @@ Creates an array of numbers in the arithmetic progression, starting with the giv - Use `Array.from()` to create an array of the desired length, `lim/n`, and a map function to fill it with the desired values in the given range. ```js -const arithmeticProgression = (n, lim) => +const arithmeticProgression = (n, lim) => Array.from({ length: Math.ceil(lim / n) }, (_, i) => (i + 1) * n ); ``` diff --git a/snippets/binomialCoefficient.md b/snippets/binomialCoefficient.md index 3e0267ea2..791283296 100644 --- a/snippets/binomialCoefficient.md +++ b/snippets/binomialCoefficient.md @@ -1,6 +1,6 @@ --- title: binomialCoefficient -tags: math,beginner +tags: math,algorithm,beginner --- Calculates the number of ways to choose `k` items from `n` items without repetition and without order. diff --git a/snippets/distance.md b/snippets/distance.md index 6bf24f641..bc375a64e 100644 --- a/snippets/distance.md +++ b/snippets/distance.md @@ -1,6 +1,6 @@ --- title: distance -tags: math,beginner +tags: math,algorithm,beginner --- Calculates the distance between two points. diff --git a/snippets/factorial.md b/snippets/factorial.md index 2c6eb1acb..cddd9f499 100644 --- a/snippets/factorial.md +++ b/snippets/factorial.md @@ -1,6 +1,6 @@ --- title: factorial -tags: math,recursion,beginner +tags: math,algorithm,recursion,beginner --- Calculates the factorial of a number. diff --git a/snippets/fibonacci.md b/snippets/fibonacci.md index 37df66289..c761e9c5b 100644 --- a/snippets/fibonacci.md +++ b/snippets/fibonacci.md @@ -1,6 +1,6 @@ --- title: fibonacci -tags: math,intermediate +tags: math,algorithm,intermediate --- Generates an array, containing the Fibonacci sequence, up until the nth term. diff --git a/snippets/gcd.md b/snippets/gcd.md index b662823e6..b262f7221 100644 --- a/snippets/gcd.md +++ b/snippets/gcd.md @@ -1,6 +1,6 @@ --- title: gcd -tags: math,recursion,beginner +tags: math,algorithm,recursion,beginner --- Calculates the greatest common divisor between two or more numbers/arrays. diff --git a/snippets/geometricProgression.md b/snippets/geometricProgression.md index 40a7b7c47..cdd3a6f35 100644 --- a/snippets/geometricProgression.md +++ b/snippets/geometricProgression.md @@ -1,6 +1,6 @@ --- title: geometricProgression -tags: math,intermediate +tags: math,algorithm,intermediate --- Initializes an array containing the numbers in the specified range where `start` and `end` are inclusive and the ratio between two terms is `step`. diff --git a/snippets/hammingDistance.md b/snippets/hammingDistance.md index 51530ad35..24b30f65b 100644 --- a/snippets/hammingDistance.md +++ b/snippets/hammingDistance.md @@ -1,6 +1,6 @@ --- title: hammingDistance -tags: math,intermediate +tags: math,algorithm,intermediate --- Calculates the Hamming distance between two values. diff --git a/snippets/isPrime.md b/snippets/isPrime.md index 52f56c8ca..6aa2a231e 100644 --- a/snippets/isPrime.md +++ b/snippets/isPrime.md @@ -1,6 +1,6 @@ --- title: isPrime -tags: math,beginner +tags: math,algorithm,beginner --- Checks if the provided integer is a prime number. diff --git a/snippets/lcm.md b/snippets/lcm.md index 2e63fbe1b..66667a8c0 100644 --- a/snippets/lcm.md +++ b/snippets/lcm.md @@ -1,6 +1,6 @@ --- title: lcm -tags: math,recursion,intermediate +tags: math,algorithm,recursion,intermediate --- Calculates the least common multiple of two or more numbers. diff --git a/snippets/luhnCheck.md b/snippets/luhnCheck.md index 42bf9f318..fa842f1da 100644 --- a/snippets/luhnCheck.md +++ b/snippets/luhnCheck.md @@ -1,6 +1,6 @@ --- title: luhnCheck -tags: math,advanced +tags: math,algorithm,advanced --- Implementation of the [Luhn Algorithm](https://en.wikipedia.org/wiki/Luhn_algorithm) used to validate a variety of identification numbers, such as credit card numbers, IMEI numbers, National Provider Identifier numbers etc. diff --git a/snippets/permutations.md b/snippets/permutations.md index 1c10d8782..8e94d7b5b 100644 --- a/snippets/permutations.md +++ b/snippets/permutations.md @@ -1,6 +1,6 @@ --- title: permutations -tags: array,recursion,advanced +tags: array,algorithm,recursion,advanced --- Generates all permutations of an array's elements (contains duplicates). diff --git a/snippets/powerset.md b/snippets/powerset.md index 823c60ab4..973f4dadb 100644 --- a/snippets/powerset.md +++ b/snippets/powerset.md @@ -1,6 +1,6 @@ --- title: powerset -tags: math,beginner +tags: math,algorithm,beginner --- Returns the powerset of a given array of numbers. diff --git a/snippets/primes.md b/snippets/primes.md index 0f21b1c48..303ffeaab 100644 --- a/snippets/primes.md +++ b/snippets/primes.md @@ -1,6 +1,6 @@ --- title: primes -tags: math,intermediate +tags: math,algorithm,intermediate --- Generates primes up to a given number, using the Sieve of Eratosthenes. diff --git a/snippets/vectorDistance.md b/snippets/vectorDistance.md index df660c9f5..8daf94d6f 100644 --- a/snippets/vectorDistance.md +++ b/snippets/vectorDistance.md @@ -1,6 +1,6 @@ --- title: vectorDistance -tags: math,beginner +tags: math,algorithm,beginner --- Calculates the distance between two vectors.