mirror of
https://github.com/TheAlgorithms/JavaScript.git
synced 2025-07-04 15:39:42 +08:00

* new algorithm 'Sliding-Window' added with example 'Longest Substring Without Repeating Characters' * new example of sliding window 'Permutation in String' added * chore: add `ignore_words_list` * sliding-window moved into Dynamic-programming directory Co-authored-by: Rak Laptudirm <raklaptudirm@gmail.com>
12 lines
629 B
JavaScript
12 lines
629 B
JavaScript
import { LongestSubstringWithoutRepeatingCharacters } from '../LongestSubstringWithoutRepeatingCharacters.js'
|
|
|
|
describe('LongestSubstringWithoutRepeatingCharacters', () => {
|
|
it('should return longest substring without repeating characters', () => {
|
|
expect(LongestSubstringWithoutRepeatingCharacters('abcabcbb')).toEqual(3)
|
|
expect(LongestSubstringWithoutRepeatingCharacters('bbbbb')).toEqual(1)
|
|
expect(LongestSubstringWithoutRepeatingCharacters('pwwkew')).toEqual(3)
|
|
expect(LongestSubstringWithoutRepeatingCharacters('a')).toEqual(1)
|
|
expect(LongestSubstringWithoutRepeatingCharacters('')).toEqual(0)
|
|
})
|
|
})
|