и посмотреть медиа
JavaScript | LeetCode
и посмотреть медиа
LeetCode tasks and solutions in JavaScript. Ideal for interview preparation and improving algorithm skills.
LeetCode tasks and solutions in JavaScript. Ideal for interview preparation and improving algorithm skills.
AI bot for text-to-speech and voice cloning in Telegram. Create audio using neural network quickly and easily.
The channel is dedicated to solving LeetCode tasks in JavaScript. It contains code examples for popular algorithmic problems frequently encountered in interviews. The materials will help master data structures, sorting, dynamic programming, and other key topics. Suitable for junior and middle developers looking to improve their skills.
Задача: 1062. Longest Repeating Substring Сложность: medium Дана строка s. Вернуть длину самой длинной повторяющейся подстроки. Если повторяющаяся подстрока отсутствует, вернуть 0. Пример: Input: s = "abcd" Output: 0 Explanation: There is no repeating substring. 👨💻 Алгоритм: 1⃣Перемещайте скользящее окно длиной L по строке длиной N. 2⃣Проверьте, находится ли строка в скользящем окне в хэш-наборе уже виденных строк. Если да, то повторяющаяся подстрока находится здесь. Если нет, сохраните строку из скользящего окна в хэш-наборе. 3⃣Очевидный недостаток этого подхода — большое потребление памяти в случае длинных строк. 😎 Решение: class Solution { search(L, n, S) { const seen = new Set(); for (let start = 0; start
Открыть канал и посмотреть медиаOnly registered users can share their opinion.
Be the first to share your impression of this resource!