This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
getUniqueSubstrLengths(''); // result -> [] | |
getUniqueSubstrLengths('a'); // result -> [1] | |
getUniqueSubstrLengths('ab'); // result -> [1, 1] | |
getUniqueSubstrLengths('abc'); // result -> [1, 1, 1] | |
getUniqueSubstrLengths('abobc'); // result -> [1, 3, 1] | |
getUniqueSubstrLengths('aazz'); // result -> [2, 2] | |
getUniqueSubstrLengths('ababdeedhigthtdfgfdgbjxfvsdpkcweqfkoeriovsmxpoozzzzz'); // result -> [47, 5] | |
getUniqueSubstrLengths('hkjljlkklkjlk'); // result -> [1, 12] | |
getUniqueSubstrLengths('ababdeeda'); // result -> [9] | |
getUniqueSubstrLengths('ababdeedhigtht'); // result -> [4, 4, 6] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const getNextState = (str, end) => { | |
let i, | |
start = str[0], | |
substr = '', | |
count = 1; | |
for (i = 1; i < str.length; i++) { | |
if (start === str[i]) { | |
count++; | |
if (end < i) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html xmlns="http://www.w3.org/1999/xhtml" > | |
<head> | |
<title></title> | |
<meta http-equiv="X-UA-Compatible" content="IE=edge"> | |
<link rel="stylesheet" type="text/css" href="style.css"> | |
</head> | |
<body> | |
<!-- Галереи и картинки можно добавлять в любом кол-ве(только нужно сохранять названия классов) --> |