mirror of
https://github.com/TheAlgorithms/JavaScript.git
synced 2025-07-04 07:29:47 +08:00
fixed some spellings
This commit is contained in:
@ -10,7 +10,7 @@ function KadaneAlgo (array) {
|
||||
}
|
||||
}
|
||||
return maxSum
|
||||
// This function returns largest sum contigous sum in a array
|
||||
// This function returns largest sum contiguous sum in a array
|
||||
}
|
||||
function main () {
|
||||
const myArray = [1, 2, 3, 4, -6]
|
||||
|
@ -2,7 +2,7 @@ function sieveOfEratosthenes (n) {
|
||||
/*
|
||||
* Calculates prime numbers till a number n
|
||||
* :param n: Number upto which to calculate primes
|
||||
* :return: A boolean list contaning only primes
|
||||
* :return: A boolean list containing only primes
|
||||
*/
|
||||
const primes = new Array(n + 1)
|
||||
primes.fill(true) // set all as true initially
|
||||
|
@ -1,19 +1,19 @@
|
||||
import { longestPalindromeSubsequence } from '../LongestPalindromicSubsequence'
|
||||
|
||||
describe('LongestPalindromicSubsequence', () => {
|
||||
it('expects to return 1 as longest pallindromic subsequence', () => {
|
||||
it('expects to return 1 as longest palindromic subsequence', () => {
|
||||
expect(longestPalindromeSubsequence('abcdefgh')).toBe(1)
|
||||
})
|
||||
|
||||
it('expects to return 4 as longest pallindromic subsequence', () => {
|
||||
it('expects to return 4 as longest palindromic subsequence', () => {
|
||||
expect(longestPalindromeSubsequence('bbbab')).toBe(4)
|
||||
})
|
||||
|
||||
it('expects to return 2 as longest pallindromic subsequence', () => {
|
||||
it('expects to return 2 as longest palindromic subsequence', () => {
|
||||
expect(longestPalindromeSubsequence('cbbd')).toBe(2)
|
||||
})
|
||||
|
||||
it('expects to return 7 as longest pallindromic subsequence', () => {
|
||||
it('expects to return 7 as longest palindromic subsequence', () => {
|
||||
expect(longestPalindromeSubsequence('racexyzcxar')).toBe(7)
|
||||
})
|
||||
})
|
||||
|
Reference in New Issue
Block a user